Is there a JS function that will turn [/a/, []] into "[/a/, []]"? JSON.stringify mangles regexes and toString() mangles arrays. > JSON.stringify([/a/, []]) '[{},[]]' > [/a/, []].toString() '/a/,'
-
-
If you're using Node and are just using it for debug purposes then you can also use `require('util').inspect`.
-
Inspect's whitespace handling is a problem for esoteric reasons, but it's good to know about both of these options for the future; thanks!
End of conversation
New conversation -
-
-
For more info, see MDN for the `replacer` function: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Example_replacer_as_a_function …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 