Skip to content
AgileLogics
4 min read

JavaScript Syntax

Prerequisites: Your first JavaScript program

Unlike Python, JavaScript uses curly braces { } to group a block of code, not indentation — though consistent indentation is still expected for readability.

if (true) {
    console.log("This line is inside the if block");
    console.log("So is this one");
}
console.log("This line is not — it always runs");

Statements typically end with a semicolon ;. Whitespace and indentation are purely cosmetic — they never change what the code does.