I have the following code in Ruby. I want to convert this code into JavaScript. what's the equivalent code in JS?
text = <<"HERE"
This
Is
A
Multiline
String
HERE
I have the following code in Ruby. I want to convert this code into JavaScript. what's the equivalent code in JS?
|
|||||||||||||
|
I think I discovered another way to do it inline without any invasive syntax on every line. Use Javascript's ability to convert a function to string and create a multiline comment with the
The only pitfall I can see in this is the syntax highlighting. EDIT: Had I scrolled down a little more, I would have seen this answer doing exactly the same thing: http://stackoverflow.com/a/5571069/916553 |
||||
|
It's not extremely elegant but it's clean enough for me:
|
|||||||||||||||||||||
|
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?