Primitive & Nonprimitive
Primitive & Nonprimitive
Primitives:
Primitives are immutable data types. This means that their values
cannot be changed. When you manipulate a primitive, you're
actually creating a new value.
Example:
let str = "Hello";
let num = 42;
let bool = true;
let n = null;
let u; // undefined
let sym = Symbol("foo");
Example:
let obj = {
name: "John",
age: 30,
isStudent: false
};