Standard built-ins
BigInt.asUintN()
Reduces a BigInt modulo 2^bits as a nonnegative result, without signed interpretation. Width zero yields 0n. An invalid width throws RangeError.
Formal Syntax & Structure
javascript syntaxjavascript
BigInt.asUintN(bits, value)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| bits | number | Nonnegative bit width after index conversion. |
| value | bigint | Input converted using ToBigInt. |
Return Value
bigint
Unsigned width-limited result.
Working Example
Example Snippetjavascript
console.log(String(BigInt.asUintN(8,-1n)));