Answers for "javascript from json to string"

4

convert json.stringify to array in javascript

const myObj = {
  name: 'Skip',
  age: 2,
  favoriteFood: 'Steak'
};

const myObjStr = JSON.stringify(myObj);

console.log(myObjStr);
// "{"name":"Skip","age":2,"favoriteFood":"Steak"}"

console.log(JSON.parse(myObjStr));
// Object {name:"Skip",age:2,favoriteFood:"Steak"}
Posted by: Guest on May-21-2020

Code answers related to "javascript from json to string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language