Livio Brunner Livio Brunner - 5 months ago 9
JSON Question

Add quotation marks to JSON Object attributes

How do I add quotation marks to a JSON Object Attributes for example like this

{name:"User 01"}


so it should look like that afterwards

{"name":"User 01"}


(both of them are strings)

SGD SGD
Answer
JSON.stringify(eval('{name:"User 01"}'));

Not really great but works.