JavaScript Syntax and Keywords
Syntax means the spelling and shape rules of the language.
Keywords are special words that JavaScript already owns.
Think of road signs. You must follow them or the trip gets messy.
What syntax means
What keywords are
Case sensitivity
Naming your own words
Syntax is the shape
Parentheses, braces, quotes, and dots all matter.
If a quote is missing, the computer gets confused.
It is like a cookie recipe. Skip sugar, and it is not the same cookie.
Keywords are reserved
Words like let, const, if, and function are keywords.
You cannot use them as your own variable names.
They already have a job.
Case matters
Name and name are different.
JavaScript cares about big letters and small letters.
Treat them like two different stickers.
Identifiers
An identifier is a name you invent for variables or functions.
Start with a letter, underscore, or dollar sign.
Do not start with a number.
Whitespace
Spaces and new lines help humans read.
JavaScript mostly ignores extra spaces.
Still, keep your code neat so future you can understand it.
Tip: If the computer complains, check quotes, braces, and spelling first. Tiny syntax mistakes cause many errors.
Test yourself
Three quick questions made just for this lesson. Earn 10 XP per correct answer.