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/,'
-
Show this thread
-
how do things that are easy in other programming languages always manage to be difficult in JavaScript $ ruby -e 'puts [/a/, []].inspect' [/a/, []]
2 replies 1 retweet 17 likesShow this thread
Replying to @garybernhardt
(()=>[/a/, []]).toString().replace("()=>", "") :trollface:
6:06 PM - 6 Aug 2018
0 replies
0 retweets
2 likes
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.