The Semicolon : Semicolon « Language Basics « JavaScript Tutorial






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.

<html>
<body>
<SCRIPT LANGUAGE="JavaScript">

<!--
// Declare 2 numeric variables on the same line
var varA = 5; var varB = 0.06;

;
document.write(varA*varB);
-->

</SCRIPT>
</body>
</html>








1.6.Semicolon
1.6.1.The Semicolon
1.6.2.End-of-line semicolons are optional.