JSON.stringify escaping without need

You are stringifying a string, not an object:

var str="{"2003":{"1":{"2":["test"],"3":["test2"]}}}";
var obj = {"2003":{"1":{"2":["test"],"3":["test2"]}}};

console.log( JSON.stringify(str) );  // {\"2003\":{\"1\":{\"2\":[\"test\"],\"3\":[\"test2\"]}}} 
console.log( JSON.stringify(obj) );  // {"2003":{"1":{"2":["test"],"3":["test2"]}}} 

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)