JS Built-ins
BigInttoStringbeginner

BigInt.prototype.toString() β€” decimal

πŸ“– Usage Example
42n.toString()     // β†’ '42'
42n.toString(2)   // β†’ '101010' (binary)

toString() converts a BigInt to a string, optionally in a given base (radix).

BigInt toString()

(10n).toString() converts the BigInt to a decimal string '10'.

Challenge: Verify the string conversion.

πŸ’‘ Hints (1)
  • β€’ toString() with no argument defaults to base 10.