Primitive Data Types Recap
Let's quickly summarize what has been discussed so far:
There are five primitive data types in JavaScript:
number
string
boolean
undefined
null
Everything that is not a primitive is an object
The number data type can store positive and negative integers or floats, hexadecimal numbers, octal numbers, exponents, and the special numbers
NaN
,Infinity
, and–Infinity
The string data type contains characters in quotes
The only values of the boolean data type are
true
andfalse
The only value of the null data type is the value
null
The only value of the undefined data type is the value
undefined
All values become
true
when converted to a boolean, with the exception of the six falsy values:""
null
undefined
0
NaN
false