Number Methods

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

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.

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()
Convert a number to a string of its specificied precision form.
.toString()
Converts a number to a string.
Edit this page on GitHub

Contributors

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

Learn JavaScript on Codecademy

Edit this page on GitHub

Contributors