History of Idiom 48 > diff from v34 to v35
Edit summary for version 35 by programming-idioms.org:
[JS] Several ways -> new impls 2129 and 2130
[JS] Several ways -> new impls 2129 and 2130
↷
Version 34
2017-10-01, 11:28:01
Version 35
2017-10-01, 11:30:44
Idiom #48 Multi-line string literal
Assign to variable s a string literal consisting in several lines of text
Idiom #48 Multi-line string literal
Assign to variable s a string literal consisting in several lines of text
Extra Keywords
multiline rawExtra Keywords
multiline rawCode
let s = "This is a very long string which needs " +
"to wrap across multiple lines because " +
"otherwise my code is unreadable.";
let r = "This is a very long string which needs \
to wrap across multiple lines because \
otherwise my code is unreadable.";
let t = `This is a very long string which needs
to wrap across multiple lines because
otherwise my code is unreadable.`;
Comments bubble
There is the concatenation method as seen in longString1.
Backslash-newline also works but requires no indentation as seen in longString2.
And ES6 allows so-called "template literals" which allow them by default!
Comments bubble