Object: and any structured type is derived from
null by the Prototype Chain.
Most of the time, a primitive value is represented directly at the lowest level of the language implementation.
All primitives are immutable, i.e., they cannot be altered. It is important not to confuse a primitive itself with a variable assigned a primitive value. The variable may be reassigned a new value, but the existing value can not be changed in the ways that objects, arrays, and functions can be altered.
This example will help you understand that primitive values are immutable.
// Using a string method doesn't mutate the string var bar = "baz"; console.log(bar); // baz bar.toUpperCase(); console.log(bar); // baz // Using an array method mutates the array var foo = ; console.log(foo); //  foo.push("plugh"); console.log(foo); // ["plugh"] // Assignment gives the primitive a new (not a mutated) value bar = bar.toUpperCase(); // BAZ
A primitive can be replaced, but it can't be directly altered.
undefined, all primitive values have object equivalents that wrap around the primitive values:
Stringfor the string primitive.
Numberfor the number primitive.
BigIntfor the bigint primitive.
Booleanfor the boolean primitive.
Symbolfor the symbol primitive.
valueOf() method returns the primitive value.