Data Types

A data type defines the kind of value a variable can hold. JavaScript is dynamically typed, meaning variables can change their data types as their values change. Data types in JavaScript are broadly categorized into primitive and non-primitive types. Primitive data types are immutable and stored by value. These include Number for numeric values, String for text, Boolean for true/false, Undefined for unassigned variables, Null for intentional absence of a value, BigInt for very large integers, and Symbol for unique identifiers. Non-primitive data types, also known as reference types, are mutable and stored by reference. The primary non-primitive types are Object, which is a collection of key-value pairs, and Array, which is an ordered, dynamic list of elements that are specialized objects.