TYPES OF NUMERIC DATA TYPES IN JS:
- NULL.
- UNDEFINED.
NULL:
Does not belong to any of the default data types. It forms a separate type of its own which contains only the null value.
EXAMPLE:
let age = null;
console.log(age)
UNDEFINED:
A variable that has been declared but not initialized with a value is automatically assigned the undefined value. It means the variable exists, but it has no value assigned to it.
EXAMPLE:
let x;
console.log(x); // Output: undefined
function doSomething() {
}
console.log(doSomething());
let obj = {};
console.log(obj.property);
Top comments (0)