Primitive Datatypes
Primitive datatypes are the simple building blocks.
Each one holds a single basic value.
Think of loose stickers. One sticker per value.
string
number
boolean
null and undefined
symbol and bigint
String
A string is text.
Wrap it in quotes.
Number
A number can be whole or with a decimal.
JavaScript uses one number type for both.
Boolean
A boolean is only true or false.
It is a tiny yes or no switch.
Undefined
Undefined means a box exists but nothing was put in yet.
JavaScript gives this starter value.
Null
Null means empty on purpose.
You chose to put nothing there.
Note: typeof null says object. That is an old quirk.
Symbol and BigInt
Symbol makes a unique tag.
BigInt holds very big whole numbers.
Tip: Master string, number, boolean, null, and undefined first. The rest show up later when you need them.
Test yourself
Three quick questions made just for this lesson. Earn 10 XP per correct answer.