JS: Number (class)

By Xah Lee. Date: . Last updated: .

What is the Keyword β€œNumber”

Number is the value of the property key "Number" of the Global Object .

console.assert(globalThis["Number"] === Number);

Type

Type of Number is a function.

console.assert(typeof Number === "function");

Parent

Parent of Number is Function.prototype.

console.assert(Reflect.getPrototypeOf(Number) === Function.prototype);

Purpose

Purpose of Number is:

Number Constructor

Properties


Number.NaN

Value is NaN.

console.assert(Number.isNaN(Number.NaN));
Number.NEGATIVE_INFINITY

Value is -Infinity.

console.assert(Number.NEGATIVE_INFINITY === -Infinity);
Number.POSITIVE_INFINITY

Value is +Infinity.

console.assert(Number.POSITIVE_INFINITY === Infinity);

JavaScript. Number