Skip to content
JSON기술 정리

JSON basics: serializing with stringify and deserializing with parse

1 min readTech notesMoved from my Tistory blogRead the Korean original

JSON : JavaScript Object Notation

  1. Created an object named sungjun
js
const sungjun ={
  name:'sungjun',
  age:24,
  eat: ()=>{
    console.log('eat');
  }
}
  1. Serializing - turns an object into a string.

stringify(), a static function of JSON, converts an Object to JSON.

js
const json = JSON.stringify(sungjun);
console.log(json);
console.log(sungjun);
  1. Deserializing - converts string data into a JavaScript object.

parse(), a static function of JSON, converts JSON to an Object.

js
const object = JSON.parse(json);
console.log(object);
  • #Deserializing
  • #JSON : JavaScript Object Notation
  • #Serializing

More in Tech notes