I have a long HTML snippet. I want some javascript variable to be the same, and for ease of maintenance, I want to save it with the actual newline characters instead of adding \ n (or as HTML, just omitting the newline characters). In Python, I would do something like:
largeString = """Hello This is long!"""
And that will work just fine. However, I have not seen a way to do this in JavaScript.
Additional information: javascript is in the external .js file, and the fragment is really quite large (~ 6kb).
Python power
source share