Datatypes
JavaScript datatypes are the classifications of data used in programming to define the nature of values. They include:
- Primitive Data Types: These are basic data types that are immutable (unchangeable) and directly hold values. They include:
- Number: Represents numeric values like integers and floating-point numbers.
- String: Represents textual data enclosed within single or double quotes.
- Boolean: Represents true or false values.
- Undefined: Represents a variable that has been declared but not assigned a value.
- Null: Represents the absence of any value or object.
- Symbol (added in ECMAScript 6): Represents a unique identifier.
Composite Data Types: These are data types that can hold multiple values and are mutable (changeable). They include:
- Object: Represents a collection of key-value pairs where values can be of any datatype, including other objects, functions, and arrays.
- Array: Represents a list-like collection of elements, each identified by an index starting from 0.
Understanding these datatypes is crucial for effectively managing data and performing operations in JavaScript programs.
Resources
Datatypes | Codeguage
Datatypes and structures MDN
The Complete JS Course - Udemy | Datatypes*
Data Types | freeCodeCamp YouTube
01-0 Basics | Web Bae
Problem
Datatypes Quiz | Codeguage