Answers for "how to parse string to json in javascript"

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
6

js string to json

var obj = JSON.parse("{no:'u',my:'sql'}");//returnes {no:'u',my:'sql'}
Posted by: Guest on April-08-2020
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

how to convert json to javascript object

local storage JSON.parse
Posted by: Guest on November-19-2020

Code answers related to "how to parse string to json in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language