2 ms·
I don't think that there is the need for a new character. The problem here is that JS has automatic semicolon insertion. This: var a = "abc def"; generat
by program 15y ago
I don't think that there is the need for a new character. The problem here is that JS has automatic semicolon insertion. This:
var a = "abc
def";
generate a "unterminated string literal" syntax error cause a semicolon is inserted after abc. Why not using C/C++/ObjC syntax?
var a = "a very "
"very long string";
- dbattaglia 15y agoThe only thing about the C syntax version is you still end up with a bunch of double quotes all over the place. The #1 reason I have for using multi-line strings currently is when writing full-out SQL or Javascript code inside C#; using C#'s @-prefixed strings make the whole thing a lot prettier to look at IMO. For me personally I'll probably never have to write multi-line JS strings more than once a year so I don't really care about the feature, but I do agree with their way of implementing them.