JavaScript will allow you to break a statement into two lines:

Example 1

var x =
"Hello World!";

But, breaking a statement in the middle of a string will not work:

Example 2

var x = "Hello
World!";

You must use a "backslash" if you must break a statement in a string:

Example 3

var x = "Hello \
World!";



Practice Excercise Practice now