dev-resources.site
for different kinds of informations.
Understanding Data Types in JavaScript
Published at
2/26/2024
Categories
javascript
beginners
tutorial
discuss
Author
Himanshu Gupta
In JavaScript, data types play a crucial role in defining the nature of variables and how they behave in our code. Broadly, JavaScript data types can be classified into two categories: Primitive and Non-Primitive (also known as Reference or Object) data types.
Primitive Data Types
Primitive data types are immutable and hold primitive values directly. They are the basic building blocks of data manipulation in JavaScript. Let's take a closer look at each primitive data type along with its typeof output:
- Number: Represents numeric values.
- String: Represents textual data.
- Boolean: Represents true or false values.
- BigInt: Represents integers with arbitrary precision.
- Symbol: Represents unique identifiers.
- Null: Represents the absence of any value.
- Undefined: Represents a variable that has been declared but has not been assigned a value.
Non-Primitive Data Types
Non-primitive data types are mutable and store references to memory locations. They are more complex data structures and include objects, arrays, and functions.
- Object: Represents a collection of key-value pairs. 2, Array: Represents a collection of elements arranged in an ordered list. 3, Function: Represents executable code blocks that can be invoked.
Articles
12 articles in total
Understanding the Internet of Things (IoT)
read article
Exploring the Conversational AI Landscape: A Tour of Leading Platforms
read article
What Are Standalone Components Angular 17 ?
read article
Browser Extensions for 2024
read article
Devin AI: Is This the Future of Software Engineering?
read article
VSCode Extensions for 2024
read article
what is different div and span
read article
What is Event propagation, capturing, bubbling ?
read article
What is the Difference between Spread and Rest Operator in JavaScript
read article
What is Javascript Singleton Object with example
read article
Understanding Data Types in JavaScript
currently reading
What is the Difference between Server Side Rendering and Client Side Rendering
read article
Featured ones: