来自Chrome的我习惯于在developer控制台中生成一个非转义字符串:
> JSON.stringify(JSON.parse('{"a": 10}'))
{"a":10}然而,在火狐中,生成以下内容:
> JSON.stringify(JSON.parse('{"a": 10}'))
"{\"a\":10}" <-- notice that the quote has been escaped as \", which is correct, but not what I want如何指示Firefox停止转义JS控制台中打印的字符串?
发布于 2020-11-09 19:25:33
您可以这样简单地使用console.log():
> console.log(JSON.stringify(JSON.parse('{"a":10}')))
{"a":10}
干杯!
https://stackoverflow.com/questions/64757827
复制相似问题