Skip to content
Related Articles

Related Articles

JavaScript Number Complete Reference

Improve Article
Save Article
  • Last Updated : 23 Nov, 2022
Improve Article
Save Article

JavaScript numbers are always stored in double-precision 64-bit binary format IEEE 754. The types of number literals You can use decimal, binary, octal, and hexadecimal.

Syntax:

Number(object)

Javascript




<script>
    // JavaScript to illustrate Number() function
    function func() {
  
        // Original string
        var a = "10 20";
  
        var value = Number(a);
        console.log(value);
    }
// Driver code
func();
</script>

Output

1

The complete list of JavaScript Number are listed below:

Functions:

Javascript Number FunctionDescription
Javascript Number() FunctionThe Number() function is used to convert the data type to a number.

Constructors:

JavaScript Number Constructor

Description

JavaScript Number constructor PropertyThe Number constructor Property in Javascript is used to return the number constructor function for the object. 

Static Properties:

JavaScript Number Static Properties

 Description 

JavaScript Number.MIN_SAFE_INTEGER ConstantThe JavaScript Number.MIN_SAFE_INTEGER is a constant number that represents the minimum safe integer.
JavaScript Number.MAX_SAFE_INTEGER ConstantThe JavaScript Number.MAX_SAFE_INTEGER is a constant number that represents the minimum safe integer.
JavaScript Number.MAX_VALUE & Number.MIN_VALUE PropertyNumber.MAX_VALUE and Number.MIN_VALUE is used to represent maximum and minimum numeric value in javascript.
JavaScript Number NEGATIVE_INFINITY PropertyIn JavaScript, NEGATIVE_INFINITY is a property of a number object which represents negative infinity (-Infinity).
JavaScript Number Positive_INFINITY propertyIn javascript Number.POSITIVE_INFINITY represents the largest positive value i.e positive infinity.
JavaScript Number NaN PropertyIn JavaScript, NaN stands for Not a Number. It represents a value that is not a valid number.
JavaScript Number Prototype PropertyNumber object in JavaScript is used to manipulate numbers whether it is negative or positive.

Static Methods:

JavaScript Number Static Methods

 Description 

JavaScript Number.isNaN() MethodThe Number.isNan method in JavaScript is used to determine whether the passed value is NaN(Not a Number) and is of the type “Number”.
JavaScript Number.isFinite() Methodhe Number.isfinite() method in JavaScript is used to check whether the passed value is a finite number or not.
JavaScript Number.isInteger( ) MethodIt returns true if the passed value is an integer, otherwise, it returns false.
JavaScript Number isSafeInteger() MethodA number that can be represented as an IEEE-754 double precision number i.e. all integers from (253 – 1) to -(253 – 1)).
JavaScript parseFloat() FunctionThe parseFloat() function is used to accept the string and convert it into a floating-point number.
JavaScript parseInt() FunctionNumber object in JavaScript is used to manipulate numbers whether it is negative or positive. 

Instance Methods:

JavaScript Number Instance methods

Description 

JavaScript Number toExponential() MethodThe toExponential() method in JavaScript is used to convert a number to its exponential form. It returns a string representing the Number object in exponential notation.
JavaScript Number toFixed( ) MethodThe toFixed() method in JavaScript is used to format a number using fixed-point notation.
JavaScript Number toPrecision( ) MethodThe toPrecision() method in Javascript is used to format a number to a specific precision or length.
JavaScript Number toString() MethodThe toString() method in Javascript is used with a number and converts the number to a string. It is used to return a string representing the specified Number object.
JavaScript Number valueOf( ) MethodThe valueof() method in JavaScript is used to return the primitive value of a number.

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!