Number Methods

The Number object is used to represent numbers, like 3.14, -10, or 2022, and it comes with a handful of methods that’s useful for handling with numbers.

JavaScript treats primitive values as objects when it’s executing methods and properties.

Number Methods

.isFinite()
Determines whether the passed value is a finite number.
.isInteger()
Determines whether the passed value is an integer.
.isNaN()
Determines whether the passed value is NaN.
.toExponential()
Converts a number to a string of its exponential form.
.toFixed()
Converts a number to a string of its fixed-point decimal form.
.toLocaleString()
Converts a date to a string of its language-sensitivie form.
.toPrecision()
Converts a number to a string of its specified precision form.
.toString()
Converts a number to a string.

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn JavaScript on Codecademy