JS: BigInt (class)
(new in JS: ECMAScript 2020)
What is the Keyword “BigInt”
BigInt
is the value of the property key "BigInt"
of the Global Object
.
console.log(globalThis["BigInt"] === BigInt);
Type
Type of BigInt
is a function.
console.log(typeof BigInt === "function");
Parent
Parent of BigInt
is Function.prototype.
console.log(Reflect.getPrototypeOf(BigInt) === Function.prototype);
Purpose
Purpose of BigInt
is:
For integers larger than
Number.MAX_SAFE_INTEGER
or smaller than
Number.MIN_SAFE_INTEGER