How can I convert a string to object? that is my data :
"({"test1":[{"test2":55,"test":"15.06"},
{"test3":55,"test4":"15.08"}]})"
How can I convert a string to object? that is my data :
"({"test1":[{"test2":55,"test":"15.06"},
{"test3":55,"test4":"15.08"}]})"
If you remove the surrounding parentheses, you will get a JSON string, which can be converted to an object using JSON.parse():
var s = '({"test1":[{"test2":55,"test":"15.06"}, {"test3":55,"test4":"15.08"}]})',
j = s.replace(/^\((.+)\)$/, '$1'), //remove surrounding parentheses
o = JSON.parse(j);
console.log(o);