Primitive data types recap
Let's quickly summarize some of the main points discussed so far:
- There are five primitive data types in JavaScript:
- Number
- String
- Boolean
- Undefined
- Null
- Everything that is not a primitive data type is an object.
The primitive 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. Template literals allow embedding of expressions inside a string.
- The only values of the Boolean data type are
true
andfalse
. - The only value of the null data type is the
null
value. - The only value of the undefined data type is the
undefined
value. - All values become
true
when converted to ...
Get Object-Oriented JavaScript - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.