1console.log(`i am a multiline
2string
3and it works
4but not on all browsers
5- yet
6`);
1/*
2 Use to format long strings without crossing ruler length
3 or affecting string display. NOTE: use grave-accents/backticks: `
4*/
5function getLongString() {
6 return `
7 Bacon ipsum dolor amet boudin pastrami shankle ham fatback
8 pork. Short ribs ham beef, filet mignon ball tip sirloin
9 shankle t-bone drumstick. Ground round drumstick pancetta
10 fatback alcatra.
11 `;
12}
13
14function getDynamicMessage() {
15 const personName = "Dave Dude";
16 const whatever = (((1 + 2) * 3) / 4);
17 return `
18 Hello, ${personName}! Here's a very long string with
19 some dynamic values in, such as: ${whatever}`;
20}
1
2// OPTION 1
3var MultilineString = `This
4is
5a multiline
6string`; // Note: use the template quotation marks above the tab key
7
8// OPTION 2
9var MultilineString = 'This \n\
10is \n\
11a multiline \n\
12string'; // Note: use the "\n\" as a newline character