codegurukool.com · Free coding tutorials & online compiler

Home › JavaScript Tutorial › JS syntax

JS syntax

Statements, case and comments.

Statements end with semicolons. JavaScript is case-sensitive. Use // for line comments and /* */ for blocks.

Example code

<p id='o'></p>
<script>
// one line comment
let myVar=5; let myvar=6; /* different names */
o.textContent=myVar+' and '+myvar;
</script>

Run this code in the online editor

← JS outputJS operators →