- Tags: Number
- Categories: JavaScript Reference, JavaScript Resources, Reference
Quick Reference
This is a quick reference list of JavaScript number methods and properties with examples of how they are used.
JavaScript – Number constructor Property
The Number constructor property returns the function that created the Number prototype.
JavaScript – Number.isFinite() Method
The Number.isFinite() method returns true if a number is finite (not Infinity, -Infinity, or NaN).
JavaScript – Number.isInteger() Method
The Number.isInteger() method returns true if a value is an integer of the datatype Number.
JavaScript – Number.isNaN() Method
The Number.isFinite() method returns true if the value is NaN (not a number), yet the type is a Number.
JavaScript – Number.isSafeInteger() Method
The Number.isFinite() method returns true if a number is a safe integer, and also of a Number data type.
JavaScript – Number.MAX_VALUE Property
The Number.MAX_VALUE property returns the largest possible number in JavaScript, which is 1.7976931348623157e+308.
JavaScript – Number.MIN_VALUE Property
The Number.MIN_VALUE property returns the smallest possible number in JavaScript, which is 5e-324.
JavaScript – Number.NaN Property
The Number.NaN property returns NaN (Not a Number).
JavaScript – Number.NEGATIVE_INFINITY Property
The Number.NEGATIVE_INFINITY property returns negative infinity.
JavaScript – Number.POSITIVE_INFINITY Property
The Number.POSITIVE_INFINITY property returns positive infinity.
JavaScript – Number.prototype Property
The Number.prototype property allows the addition of new properties and methods to numbers.
JavaScript – Number toExponential() Method
The Number toExponential() method converts a number into exponential notation.
JavaScript – Number toFixed() Method
The Number toFixed() method converts a number to a string, while rounding the string to a specified number of decimals.
JavaScript – Number toLocaleString() Method
The Number toLocaleString() method returns a number as a string, using locale settings.
JavaScript – Number toPrecision() Method
The Number toPrecision() method formats a number to a specified length, adding a decimal point and zeroes if necessary to achieve the length.
JavaScript – Number toString() Method
The Number toString() method returns a number as a string.
JavaScript – Number valueOf() Method
The Number valueOf() method returns the primitive value of a number.
We’d like to acknowledge that we learned a great deal of our coding from W3Schools and TutorialsPoint, borrowing heavily from their teaching process and excellent code examples. We highly recommend both sites to deepen your experience, and further your coding journey. We’re just hitting the basics here at 1SMARTchicken.
Why 1SMARTchicken?
See More →
Thanks for your support!
JavaScript Books
All are affiliate links. Thank you for your support!
JAVASCRIPT NOTES:
- When using JavaScript, single or double quotation marks are acceptable and work identically to one another; choose whichever you prefer, and stay consistent
- JavaScript is a case-sensitive language; firstName is NOT the same as firstname
- Arrays count starting from zero NOT one; so item 1 is position [0], item 2 is position [1], and item 3 is position [2] … and so on
- JavaScript variables must begin with a letter, $, or _
- JavaScript variables are case sensitive (x is not the same as X)
Feedback
If you see an error on the page or the code itself is incorrect or incomplete, or just plain wrong, please let us know. We’re always learning. NOTE: we do not sell your information and will not send you spam emails.