What is the continuation character in javascript

From Code Trash
Jump to: navigation, search

What is the continuation character in JavaScript?

Normally if you require a long text string, you break it up into smaller chunks and then just add the chunks together:

<SCRIPT LANGUAGE="JavaScript">
 
var foobar = "Hello I wish this would" +
             " work" +
             " and it does";
 
 
</SCRIPT>

However, you can use the \ character to continue onto the next line:

<SCRIPT LANGUAGE="JavaScript">
 
var foobar = "Hello I wish this would \
work \
and it does";
 
</SCRIPT>