I have a string
str = \"{\'a\':1}\"; JSON.parse(str); VM514:1 Uncaught SyntaxError: Unexpected token \'(…)
How can I parse the above stri
var str = "{'a':1}"; str = str.replace(/'/g, '"') obj = JSON.parse(str); console.log(obj);
This solved the problem for me.