Answers for "json.encode 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
19

turn object into string javascript

var obj = {a: "a", b: "b" /*...*/};
var string = JSON.stringify(obj);
// OUTPUT:
// "{'a':'a', 'b':'b'}"
Posted by: Guest on March-19-2020
41

object to json javascript

var person={"first_name":"Tony","last_name":"Hawk","age":31};
var personJSONString=JSON.stringify(person);
Posted by: Guest on July-23-2019

Code answers related to "Javascript"

Browse Popular Code Answers by Language