JavaScript Number Complete Reference
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 codefunc();</script> |
Output
1
The complete list of JavaScript Number are listed below:
Functions:
| Javascript Number Function | Description |
|---|---|
| Javascript Number() Function | The Number() function is used to convert the data type to a number. |
Constructors:
JavaScript Number Constructor | Description |
|---|---|
| JavaScript Number constructor Property | The 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 Constant | The JavaScript Number.MIN_SAFE_INTEGER is a constant number that represents the minimum safe integer. |
| JavaScript Number.MAX_SAFE_INTEGER Constant | The JavaScript Number.MAX_SAFE_INTEGER is a constant number that represents the minimum safe integer. |
| JavaScript Number.MAX_VALUE & Number.MIN_VALUE Property | Number.MAX_VALUE and Number.MIN_VALUE is used to represent maximum and minimum numeric value in javascript. |
| JavaScript Number NEGATIVE_INFINITY Property | In JavaScript, NEGATIVE_INFINITY is a property of a number object which represents negative infinity (-Infinity). |
| JavaScript Number Positive_INFINITY property | In javascript Number.POSITIVE_INFINITY represents the largest positive value i.e positive infinity. |
| JavaScript Number NaN Property | In JavaScript, NaN stands for Not a Number. It represents a value that is not a valid number. |
| JavaScript Number Prototype Property | Number object in JavaScript is used to manipulate numbers whether it is negative or positive. |
Static Methods:
JavaScript Number Static Methods | Description |
|---|---|
| JavaScript Number.isNaN() Method | The 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() Method | he Number.isfinite() method in JavaScript is used to check whether the passed value is a finite number or not. |
| JavaScript Number.isInteger( ) Method | It returns true if the passed value is an integer, otherwise, it returns false. |
| JavaScript Number isSafeInteger() Method | A number that can be represented as an IEEE-754 double precision number i.e. all integers from (253 – 1) to -(253 – 1)). |
| JavaScript parseFloat() Function | The parseFloat() function is used to accept the string and convert it into a floating-point number. |
| JavaScript parseInt() Function | Number object in JavaScript is used to manipulate numbers whether it is negative or positive. |
Instance Methods:
JavaScript Number Instance methods | Description |
|---|---|
| JavaScript Number toExponential() Method | The 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( ) Method | The toFixed() method in JavaScript is used to format a number using fixed-point notation. |
| JavaScript Number toPrecision( ) Method | The toPrecision() method in Javascript is used to format a number to a specific precision or length. |
| JavaScript Number toString() Method | The 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( ) Method | The valueof() method in JavaScript is used to return the primitive value of a number. |





Please Login to comment...