JS Built-ins
BigIntvalueOfbeginner

BigInt.prototype.valueOf() β€” equality with BigInt()

πŸ“– Usage Example
Object(-1n).valueOf() === -1n  // β†’ true

valueOf() returns the exact BigInt primitive, preserving negative values.

BigInt valueOf() vs BigInt()

(100n).valueOf() === BigInt(100) is true.

Challenge: Verify equivalence.

πŸ’‘ Hints (1)
  • β€’ Both produce the same BigInt primitive.