int age = 10; specify the type of variable.
The Primitive Type datatype includes :
1)String ex: var color = "orange";
2)Number ex: var salary = 100;
3)Boolean(to check true or false) ex: isCatSleeping = true;
4)Null ex:refer to series 1a where in the table you see the "Registration Cost " for Andy Young has no value.
5)Undefined ex: var myCar; the variable myCar declared but has not set any value.
Note:To check the variable dataype use this function called typeof();
var color = "orange"; output is "string".
The other called complex/composite datatypes because these include Objects as well as the Primitive types.
Objects includes Array
We will learn about object-oriented programming later.
Modern browsers use ECMASCRIPT to overcome the scope of the variables. We will learn about it in series 1c. where we learn about hoisting, let, const etc.