925 B
925 B
title |
---|
Number |
Number
The Number
Javacript object represents any kind of number. JavaScript doesn't distinguish separate types of numbers, such as integers or floats. They are all stored in a unified, 64-bit Floating Point format, accorfing to the international IEEE 754 standard1.
New Number
objects are created like this: var num = new Number(value)
although most commonly they can be created simply by assigning a numeric value to a variable: var num = 1.616;
. In a non-constructor context (i.e., without the new
operator), Number
can be used to perform a type conversion. If the argument cannot be converted into a number, it returns NaN
.
Sources
- w3schools.com Staff. w3schools.com: JavaScript Numbers w3schools.com. Accessed: October 31, 2017.