v Multiline Strings - Javascript

Multiline Strings

There are various ways to include multiline strings in JavaScript. Here is the generally preferable way.

// Create a series of strings, one per desired line.
var multiline = "Hello Steve\n" +
                  "Rock on.\n" +     
                  "From Chris";


// Print the string
console.log(multiline)
Hello Steve
Rock on.
From Chris