Skip to content

Instantly share code, notes, and snippets.

@tmcw
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmcw/882a7ff752fab54d759b to your computer and use it in GitHub Desktop.
Save tmcw/882a7ff752fab54d759b to your computer and use it in GitHub Desktop.
Gist from mistakes.io
JSON.stringify({ foo: [1,2,3,4] }, function(key, val) {
if (Array.isArray(val)) return 'ARRAY' +
val.map(JSON.stringify).join(',') + 'YARRA';
return val;
}, 2).replace('ARRAY', '[').replace('YARRA', ']');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment