Very rarely is it ever spoken about, but there is a way in javascript to create a heredoc type syntax with javascript. For those who aren’t familiar with this it is basically a way to create multi-line strings. Many serverside languages have had this capability, but javascript is rarely spoken about. In fact it almost feels like a hack. Lets jump right in to an example:

var str = "\
Here is line one \
And line two \
Finally, line three! \


Pretty simple, and as you likely guessed the secret is in the “\”. Its so uncommon that syntax highlighters (like mine) don’t even recognize it. The downside is how often do you really need this in javascript, and when you do you likely will need to create a dynamic string, not a static one. Handy tip none the less. Enjoy!