JS: BigInt (class)

By Xah Lee. Date: . Last updated: .

(new in ECMAScript 2020)

What is the keyword “bigint”

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

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

Type

Type of BigInt is a function.

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

Parent

Parent of BigInt is Function.prototype.

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

Purpose

Purpose of BigInt is to allow integers larger than MAX_SAFE_INTEGER

Bigint convert function (not a constructor)

Properties

BigInt.asIntN

BigInt.asUintN

JavaScript bigint