JavaScript Number

 15 - Oct - 2021
 XpertPhp
 30

The numeric object in JavaScript controls numbers. Some numbers are integers, some numbers are floating-point numbers. When operating on these numbers, integers are also made as floating-point numbers and floating-point numbers are also made as integers.

You can create numeric objects and constructors.

Syntax

var object_name  = new Number(value);

Example

var a=102;//integer value  
var b=102.2;//floating point value  
var c=17e8;//exponent value, output: 130000  
var d=new Number(10);//integer value by number object 

JavaScript Number Constants

Let's see the list of JavaScript numeric constants with descriptions.

Constant Description
MIN_VALUE Javascript returns the smallest value here
MAX_VALUE Javascript returns the greatest value here
POSITIVE_INFINITY This is the value of positive infinity (infinity)
NEGATIVE_INFINITY This is the negative infinity value (-infinity).
NaN This is not a numerical value.