Concept Flow - Primitive data types
Start
Declare variable
Assign primitive value
Use value in code
Value stored directly
End
This flow shows how a variable is declared and assigned a primitive value, which is stored directly in memory.
let age = 25; let name = "Alice"; let isStudent = true; console.log(age, name, isStudent);
| Step | Action | Variable | Value Assigned | Type | Output |
|---|---|---|---|---|---|
| 1 | Declare and assign | age | 25 | number | |
| 2 | Declare and assign | name | "Alice" | string | |
| 3 | Declare and assign | isStudent | true | boolean | |
| 4 | Print values | age, name, isStudent | 25, "Alice", true | number, string, boolean | 25 Alice true |
| 5 | End |
| Variable | Start | After Step 1 | After Step 2 | After Step 3 | Final |
|---|---|---|---|---|---|
| age | undefined | 25 | 25 | 25 | 25 |
| name | undefined | undefined | "Alice" | "Alice" | "Alice" |
| isStudent | undefined | undefined | undefined | true | true |
Primitive data types in JavaScript include number, string, boolean, null, undefined, symbol, and bigint. They store actual values directly in variables. Assigning or copying primitives copies the value, not a reference. Primitives are immutable; changing a variable replaces its value. Use primitives for simple data like numbers, text, and true/false.