Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert a string to object javascript

var mystr = '{ "hello":"world" }' // NB: Has enclosing ""
var myobj = JSON.parse(mystr);

console.log(myobj);

result:
{
  hello: "world"
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #string #object #javascript
ADD COMMENT
Topic
Name
6+7 =