JavaScript String Escape
Escape text for a JavaScript string literal. Handles quotes, backslashes, new lines, control characters and optional \u escapes for non-ASCII.
How to use it
Paste text and choose the quotes your string will use. The escaped text can be pasted straight between those quotes in your code.