End-of-line semicolons are optional. : Semicolon « Language Basics « JavaScript Tutorial






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.

var test1 = "red"
var test2 = "blue";
1.6.Semicolon
1.6.1.The Semicolon
1.6.2.End-of-line semicolons are optional.