JS Built-ins
BigInttoStringbeginner

BigInt.prototype.toString() β€” hexadecimal

πŸ“– Usage Example
255n.toString(16)  // β†’ 'ff' (hexadecimal)

Use toString(16) to get the hexadecimal representation of a BigInt.

BigInt toString(16)

(255n).toString(16) converts the BigInt to a hex string 'ff'.

Challenge: Verify hex conversion.

πŸ’‘ Hints (1)
  • β€’ Pass 16 as the radix for hexadecimal output.