Primitive Types in JavaScript
Written on January 2, 2010
Primitive type is a type of data that represents a single value. In other words, it is not a object.
There are 6 primitive types in JavaScript
- undefined
- null: null represents lack of existence. You can set a variable to this
- boolean: true or false
- number: floating point number(there is always some decimals). There is only 1 number type in JavaScript
- string: a sequence of characters(both ‘’ and “” can be used)
- symbol(available in ES6)