Search code examples
javascriptjsonescaping

JSON.stringify doesn't escape?


I'm using `JSON.stringify? to stringify an object, but the quotes are not escaped? Am I misunderstanding that it's suppose to escape the quotes?

This is outputted into the template without any of the quotes being escaped:

{"console":{"free":false}}

Solution

  • The quotes around property names are not supposed to be escaped, only quotes inside strings. Your JSON is fine :)