The undefined type refers to those variables or object properties that are either undefined or do not exist. When a variable, for example, is declared without assigning a value to it, it is of undefined type. So
declares a variable called iAge. Its type is undefined; it can be confirmed by simply outputting its type using the typeof operator:
So our output will show that iAge is of type undefined:

So as long as no value is assigned to a variable, its type is undefined. Once a value is assigned, it will no longer be of type undefined but rather one of other types supported in JavaScript: numbers, strings, Boolean, or Null.
The null type indicates an empty value. When a variable is assigned the value null, its type becomes null. A null type variable is a placeholder that represents nothing. The following shows an example of a variable of type null:
Since null is an empty object, its type is object. We can confirm this by using the typeof operator:
That will output:
