JS Built-ins
BigIntvalueOfbeginner

BigInt.prototype.valueOf() β€” negative

πŸ“– Usage Example
Object(100n).valueOf() + 1n  // β†’ 101n

Use valueOf() to unwrap a BigInt object so you can perform arithmetic.

BigInt valueOf() Negative

(-5n).valueOf() === -5n is true.

Challenge: Verify negative BigInt valueOf.

πŸ’‘ Hints (1)
  • β€’ Negative BigInts are preserved by valueOf().