JavaScript Learning Notes: Data Types Summary

JavaScript has two main types of values: Primitive and Reference (Non-Primitive).

Primitive Types

Primitive values are immutable and stored directly in memory. There are 7 primitive types:

Reference Types (Non-Primitive)

Reference types are objects that are stored as a reference in memory. When you work with reference types, you're dealing with a reference to the object, not the actual object itself.

Type Checking

Use typeof to check the type of a variable.

console.log(typeof anotherId); // "symbol"