Logo

Programming-Idioms

History of Idiom 48 > diff from v32 to v33

Edit summary for version 33 by programming-idioms.org:
New JS implementation by user [programming-idioms.org]

Version 32

2017-09-30, 18:30:35

Version 33

2017-10-01, 11:26:47

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 raw
Extra Keywords
multiline raw
Code
let s = "This is a very long string which needs \
to wrap across multiple lines because \
otherwise my code is unreadable.";
Comments bubble
When using backslashes, indentation inside the string literal must be far left.
Doc URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#Long_literal_strings