A simple JSON stringify function which requires Array.prototype.map method.
The following users provided lots of ideas and improvements of the code.
@Kambfhase, @hartrock, @atk, @haochi, @jed
Actually, I just provided a deficient version at first. The other versions were created by these users(especially @atk). You may see the discussion below.
I have to admit that it's hard to do so in 140 bytes :-(
Maybe the escaped special characters can be escaped themselves first, like:
\n
to\\n
.