Thuta Learning
BasicProgrammingbeginner

JS Syntax

Relax. We'll talk through this in plain words — no textbook voice.

JavaScript syntax includes statements, variables, operators, and expressions.

• Statements usually end with ; (semicolon). (It's not strictly required, but you should add it anyway)

• Code blocks are defined with {...} (curly braces).

• JavaScript is case-sensitive. (myVar and myvar are not the same)

javascript
// Declaring variables
let x = 5;
let y = 10;

// An expression that calculates a value
let z = x + y;

// Output the result to the console
console.log("The value of z is: " + z);
You should see
The value of z is: 15