June
26th,
2017
On the web, you might see examples without semicolons. Ending statements with semicolon is not required, but highly recommended.
For best readability, programmers often like to avoid code lines longer than 80 characters. If a JavaScript statement does not fit on one line, the best place to break it, is after an operator:
You can also break up a code line within a text string with a single backslash:
The \ method is not the preferred method. It might not have universal support. Some browsers do not allow spaces behind the \ character.
A safer way to break up a string, is to use string addition: