Datatypes in the JavaScript
1 min readJan 7, 2021
Note: Primitive Datatypes has no method of its own. They are immutable. primitive types are not Objects. Don't confuse them with Constructors used in the JavaScript like Number(3) and Boolean(True).
There are 6 primitive datatypes present in the JavaScript .
- Boolean: True or False
- Null: it is no value.
- undefined: this is a variable which has been declared and but it has no value and “typeof undefined” is undefined.
- Number: they are number . they can be integers, float.
- String: an array of characters is string: they make sentences in javascript
- Symbol: this is the unique id . typeof Symbol() is “symbol”
Everything else in JavaScript is an object . for Example
- Array:[]
- Object : {}
- Number(3)
- Error
- Math
these are objects present in the JavaScript and you can make your own objects in the JavaScript through constructor function .
code examples for the primitive datatypes