JSON

 let jsonRes=`{"fact":"According to a Gallup poll, most American pet owners obtain their cats by adopting strays.","length":90}`;


// JSON.parse()
let validRes=JSON.parse(jsonRes);
console.log(validRes);
console.log(validRes.fact);

// JSON.stringify()
let student={
    name:"abhii",
    marks:98
};
console.log(JSON.stringify(student));

Comments

Popular posts from this blog

Callback Hell

TODO list with DOM

Refactoring callback hell code