DEV Community

Discussion on: Have a Handy JS Snippet You Want to Share?

Collapse
prodigalknight profile image
RevanProdigalKnight • Edited on

Hmm. I verified that the MDN isn't just out of date by testing in Chrome. I can't remember the context I was using that snippet in precisely, but I do remember it was designed to run in IE10+, Chrome, and Firefox.

I may have just been using it so I wouldn't have to escape all my backslashes for a string.

Thread Thread
nickytonline profile image
Nick Taylor (he/him) Author

I tried in Chrome yesterday and it doesn't error out, but it just doesn't escape.