Answers for "stringify function js"

0

stringify function js

const obj = {name: "John", age: function () {return 30;}, city: "New York"};
obj.age = obj.age.toString();
const myJSON = JSON.stringify(obj);
// myJSON will be '{"name":"John","age":"function () {return 30;}","city":"New York"}'
Posted by: Guest on September-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language