
Data Types in Node.js #
There is Six Data Types that are primitives
- String
- Number
- Boolean
- undefined
- BigInt
- Symbol
BigInt and Symbol are rarely used and In fact I also don’t use it.
How to check the data types of variable ? #
There is typeof
operator used in js to get the type of variable’s data. Let’s see some example and get more idea about the typeof operator.
> let pi = 3.14;
undefined
> typeof pi;
'number'
>
> let elon = "SpaceX";
undefined
> typeof elon;
'string'
>
> let married = false;
undefined
> typeof married;
'boolean'
>