Dhrumi Shah
Dhrumi Shah

@deetwts

12 Tweets 5 reads Apr 30, 2022
Data Types in JavaScript⚡
A Mega thread 🧵
📌What are JavaScript Data types?
JavaScript variables can hold different data types: numbers, strings, objects and more.
📌JavaScript Types are Dynamic
JavaScript has dynamic types. This means that the same variable can be used to hold different data types. We do not have to manually define the data type of the value stored in a variable. Instead, data types are determined automatically.
📌Primitive and object Data types
The values can be either of object data type (mutable) or primitive data type (immutable).
📌There are 6 data primitive types
1. Number :
JavaScript has only one type of numbers.
Numbers can be written with, or without decimals:
2. String :
Sequence of characters use to represent text.
Strings are written with quotes. You can use single or double quotes.
3. Boolean :
Logical type that can only be true or false. This is used for taking decisions.
4. Undefined :
Value taken by a variable that is not yet defined (‘empty value’).
5. Null type :
It also means empty value. It represents the intentional absence of any object value and treated as falsy for Boolean operations.
📌 Difference between Null and Undefined types :
6. BigInt :
It holds larger integer than the number type can hold.
Thanks for reading this thread ❤
If you like it , make sure you:
🔷Like the tweet
🔷Retweet the first tweet⚡
For more content , Follow:
@deetwts

Loading suggestions...