data type in JavaScript

In JavaScript, there are 6 primitive data types: string, number (floating-point), bigint (integer), boolean, undefined, and symbol. 
There also is null, which is seemingly primitive, but indeed is a special case for every Object: and any structured type is derived from null by the Prototype Chain.
All primitives are immutable, i.e., they cannot be altered. It is important not to confuse a primitive itself with a variable assigned a primitive value. The variable may be reassigned a new value, but the existing value can not be changed in the ways that objects, arrays, and functions can be altered.
Using typeof operator, we can get the data type.
```
console.log(typeof 'a');
console.log(typeof 1);
console.log(typeof true);
console.log(typeof null);
console.log(typeof undefined);
console.log(typeof Symbol('a'));
console.log(typeof [1]);
console.log(typeof {a:1});
/*
string
number
boolean
object
undefined
symbol
object
object
*/
```