Well i have a long string in double quotes
var Variable = "Really Long ...... String"
I would want to do this
var Variable = "Really
Long
......
String"
Currently I do this
var Variable = "Really\n\
Long\n\
......\n\
String"
It works correctly across all browsers. But is it the correct way to do it?
I think using the plus sign might be more effective.
In your example above, how do you know how many spaces are before the word “Long”, for example? I would not count on that being consistant across browsers.
My understanding is that using the plus sign to concatentate strings is just as efficient…javascript parsers are smart enough to handle that the same way as your example.