JavaScript Tutorial/Language Basics/Semicolon
End-of-line semicolons are optional.
JavaScript allows the developer to decide whether or not to end a line with a semicolon.
If the semicolon is not provided, JavaScript considers the end of the line as the end of the statement.
<source lang="javascript">
var test1 = "red" var test2 = "blue";</source>
The Semicolon
JavaScript executes your code accordingly even if you forget a semicolon at the end of the line.
You must use a semicolon to separate the two pieces of code when putting two independent pieces of code on one line.
<source lang="javascript">
<html> <body> <SCRIPT LANGUAGE="JavaScript">
</SCRIPT> </body> </html></source>