Python Variables & Data Types (let, const, typeof)
JavaScript features 7 primitive types: number, string, boolean, null, undefined, symbol, and bigint. Variables are declared with const (immutable binding) or let (reassignable), while typeof inspects the runtime type.
"A variable is a labeled container. const is a welded box whose contents cannot be swapped for a new item, whereas let is an open jar where you can place different values as needed."
Deep Dive: How It Works
const vs let: Use const by default. Use let only when you know the variable will be reassigned (like loop counters).
Numbers: All numbers in JavaScript are IEEE 754 double-precision floats (no separate int vs float type for standard arithmetic).
null vs undefined: undefined means a variable has been declared but not assigned. null is an intentional empty value.
Syntax Blueprint
const name = "Ada"; let score = 100; typeof score ──▶ "number"
Use const for immutable bindings, let for reassignments, and typeof to inspect data types.
Core Rules to Remember



Common Beginner Traps & How to Fix Them
Attempting to reassign a const variable.Why it happens: const prevents reassignment to a new value: TypeError: Assignment to constant variable.
How to fix: If a variable must change its value over time, declare it with let instead.
Live Interactive Example
Hit Run Code to see it liveYour Turn: Micro Challenge
No pressure! Edit the starter code below and test your solution with instant feedback.
Declare variables and inspect type
Declare const language = "JavaScript";
Declare let activeUsers = 42000;
Print "Type of language: string" using typeof language.
Print "Type of activeUsers: number" using typeof activeUsers.
Finished reading and practicing?
Mark this lesson as completed to update your course progress.