21. Primitive types #

Created Thursday 3 March 2022

There are two kinds of variable types in JavaScript:

  1. Primitive types - just values
  2. Objects - name, value pairs. Value may be an object itself.

There are 7 types of primitive types in JS, at the point of this writing:

  1. undefined - non-existence of a value, given by the JS engine. Should not be assigned to by us. Checking for it is fine though.
  2. null - non-existence of a value. This can be assigned by us.
  3. number - a floating type number.
  4. string - a string of characters. Immutable because there is no char in JS.
  5. boolean - obvious
  6. symbol - ES6+, FIXME. We are ignoring this in this course.
  7. bigint FIXME