A statement does something (let x = 5;); an expression produces a value (5 + 3). JS auto-inserts semicolons, but a few edge cases bite, so many teams write them explicitly. Code is case-sensitive and whitespace between tokens is ignored.
A statement does something (let x = 5;); an expression produces a value (5 + 3). JS auto-inserts semicolons, but a few edge cases bite, so many teams write them explicitly. Code is case-sensitive and whitespace between tokens is ignored.
<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre id="o"></pre>
<script>const sum = 5 + 3 * 2; // expression assigned in a statement
document.getElementById('o').textContent = 'sum = ' + sum;</script></body></html>▶ Open the interactive comic issue