There are 6 primitive types in JavaScript:
string
: a sequence of charactersnumber
: a numerical value, including whole numbers as well as numbers with decimalsboolean
: true/false valuesundefined
: the absence of a valuenull
: the intentional absence of a valueSymbol
: provides unique identifiers for variables
There is one more type in JavaScript, object
, but it's not considered a primitive type. We'll talk about it later in the course.
For more information on these primitive types, check out this blog post.