JavaScript syntax is the set of rules that define how JavaScript programs are written and executed.
1. JavaScript Statements
A statement is an instruction executed by the browser.
- Statements usually end with a semicolon (;)
- Semicolons are optional but recommended
2. JavaScript Case Sensitivity
JavaScript is case-sensitive.
👉 name and Name are different variables
3. Variables in JavaScript
Variables store data.
Declaring Variables
Rules
- Variable names must start with letters, _, or $
- Cannot start with numbers
- No spaces allowed
4. JavaScript Comments
Single-line Comment
Multi-line Comment
Comments improve code readability.
