Answers for "json_encode in javascript"

0

json encode js

// To encode an object (This produces a string)
var json_str = JSON.stringify(myobject); 

// To decode (This produces an object)
var obj = JSON.parse(json_str);
Posted by: Guest on September-02-2021
2

js json_encode pretty

var str = JSON.stringify(obj, null, 2); // spacing level = 2
Posted by: Guest on June-23-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language