BigInt

bigint (ES2020) is a primitive for integers of arbitrary size. Create one with an n suffix (10n) or with BigInt(), which accepts integers and integer strings. Arithmetic is exact, but division truncates toward zero, and the two numeric types never mix implicitly: 1n + 1 throws a TypeError, while comparisons such as 2n > 1 and 1n == 1 work. BigInt.asUintN(bits, n) and BigInt.asIntN(bits, n) wrap a value to a fixed width, emulating 64-bit or 8-bit integer overflow.

Exact big integers, their rules and JSON serializationJavaScriptLive
const max = BigInt(Number.MAX_SAFE_INTEGER);
console.log(max + 2n, 2n ** 64n, 7n / 2n, -7n % 3n, typeof 10n);
console.log(1n == 1, 1n === 1, BigInt("0x1f"), Number(123n) + 1, BigInt.asUintN(8, 257n));
try { 1n + 1; } catch (e) { console.log(e.message); }
try { JSON.stringify({ id: 1n }); } catch (e) { console.log(e.message); }
console.log(JSON.stringify({ id: 12345678901234567890n },
  (key, value) => (typeof value === "bigint" ? value.toString() : value)));

Math methods, unary + and >>> reject BigInts, and BigInt(1.5) throws because the argument is not an integer. JSON.stringify() throws unless you add a replacer (as above) or a toJSON() method. Converting back with Number() silently loses precision above 2^53. BigInt operations are not constant-time, so do not use them for cryptography; use Web Crypto (Web Crypto).