JavaScript syntax တွင် statements များ၊ variables များ၊ operators များ၊ expressions များပါဝင်သည်။
• Statements များသည် ; (semicolon) ဖြင့် အဆုံးသတ်လေ့ရှိသည်။ (မထည့်မနေရ မဟုတ်သော်လည်း ထည့်ပေးသင့်သည်)
• Code blocks များကို {...} (curly braces) ဖြင့် သတ်မှတ်သည်။
• JavaScript သည် case-sensitive ဖြစ်သည်။ (myVar နှင့် myvar မတူပါ)
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