MENU
Number Static Properties
Number.EPSILON
The smallest interval between two representable numbers.
Number.MAX_SAFE_INTEGER
The maximum safe integer in JavaScript (253 - 1).
Number.MAX_VALUE
The largest positive representable number.
Number.MIN_SAFE_INTEGER
The minimum safe integer in JavaScript (-(253 - 1)).
Number.MIN_VALUE
The smallest positive representable number - that is, the positive number closest to zero (without actually being zero).
Number.NaN
Special "not a number" value.
Number.NEGATIVE_INFINITY
Special value representing negative infinity; returned on overflow.
Number.POSITIVE_INFINITY
Special value representing infinity; returned on overflow.
Number.prototype
Allows the addition of properties to a Number object.
console.log(Number.EPSILON);
console.log(Number.MAX_SAFE_INTEGER);
console.log(Number.MAX_VALUE);
console.log(Number.MIN_SAFE_INTEGER);
console.log(Number.MIN_VALUE);
console.log(Number.NaN);
console.log(Number.NEGATIVE_INFINITY);
console.log(Number.POSITIVE_INFINITY);
console.log(NaN);
console.log(typeof Infinity);
// console.log(NEGATIVE_INFINITY); // ReferenceError
Number.prototype.double = function () {
return this.valueOf() * 2;
};
console.log((20).double().double());2.220446049250313e-16
9007199254740991
1.7976931348623157e+308
-9007199254740991
5e-324
NaN
-Infinity
Infinity
NaN
number
80