← JavaScript learning pathJavaScript · Module 2 of 10
Variables and types
Store values with let and const; know strings, numbers, booleans, null and undefined.
📖 Key ideas
- let declares a variable you can change; const one you cannot reassign.
- Avoid the old var keyword in new code.
- Types: string, number, boolean, null, undefined, object, array.
- typeof x tells the type.
- Template literals use backticks: `Hello ${name}`.
💡 Real-life example: const is your date of birth (fixed), let is your current city (it can change).
letVariable that can be reassigned
constVariable that cannot be reassigned
undefinedA variable with no value yet
Template literalText in backticks with ${} values