There are two types of data type in JavaScript, namely primitive type and reference type. We are going to cover primitive type over here only.
In the category of primitive types, aka value type, we have:
- String
- Number
- Boolean
- Undefined
- Null
Here are the examples:
let name = "My Name";
let age = 18;
let choice = true;
let firstName = null;
let lastName = undefined;
let's check the type of the data using typeof
in the console.