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

  1. undefined
  2. null: null represents lack of existence. You can set a variable to this
  3. boolean: true or false
  4. number: floating point number(there is always some decimals). There is only 1 number type in JavaScript
  5. string: a sequence of characters(both ‘’ and “” can be used)
  6. symbol(available in ES6)