DEV Community

Cover image for NON-NUMERIC DATA TYPES
Vinoth Kumar
Vinoth Kumar

Posted on

NON-NUMERIC DATA TYPES

TYPES OF NUMERIC DATA TYPES IN JS:

  1. NULL.
  2. 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)
Enter fullscreen mode Exit fullscreen mode

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);
Enter fullscreen mode Exit fullscreen mode

Top comments (0)