So let’s dive into it right away.
For example, in many languages you need to specifically mention that the type of data is integer or a double or a string. Those languages use what is known as Static Typing.
A primitive type is a type of data that can only have on value and is NOT a collection of items.
- Undefined: It means that there is no value
- Null: It also means that there is no value.
- Boolean: It is either true or false.
- String: It is a collection of characters that could be in a single quote or a double quote.
Here are a few examples:
//Undefined undefined //Null null //Boolean true false //Number 100 -20 0.05 1.11111 //String 'This is a String' "This is also a String" '123' "1a2b3c"