Answers for "json.stringify to object"

4

convert string to object javascript

var mystr = '{ "hello":"world" }' // NB: Has enclosing ""
var myobj = JSON.parse(mystr);
Posted by: Guest on November-04-2020
41

Javascript object to JSON string

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

convert string to object javascript

str = "firstName:name1, lastName:last1"; // NB: No enclosing ""
obj = eval('({' + str + '})');
Posted by: Guest on November-04-2020
0

json stringify

let data = {
  name: "John Smith",
  age: 30,
  hobbies: ["Programming", "Video Games"]
};
let miny = JSON.stringify(data);
Posted by: Guest on October-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language