Hint
Arbitrary-precision integers — for values beyond Number.MAX_SAFE_INTEGER (2^53 - 1)
JavaScript's Number type (64-bit float) can only safely represent integers up to 2^53 - 1 = 9,007,199,254,740,991. BigInt handles arbitrarily large integers.
// Problem: precision loss with large integers
9007199254740993 === 9007199254740992; // true! — lost a bit
// BigInt — suffix with n
9007199254740993n === 9007199254740992n; // false ✓
const big = 99999999999999999999999999n;
const sum = big + 1n; // works perfectly
// Can't mix BigInt and Number directly
1n + 1; // TypeError: Cannot mix BigInt and other types
Number(1n) + 1; // 2 — explicit conversion
BigInt(5) + 3n; // 8n — explicit conversion
// Comparison with Number (ok with ==, not ===)
1n == 1; // true (loose equality)
1n === 1; // false (strict, different types)
// No decimal support
10n / 3n; // 3n — truncates toward zero
// Math methods don't support BigInt
Math.max(1n, 2n); // TypeError