Standard built-ins

BigInt() conversion

Try the free JavaScript compiler

BigInt called as a function converts compatible values to an integer. Integer Number values, integer strings and Booleans are accepted; fractional or nonfinite Numbers are rejected. A numeric literal may already have rounded before conversion. BigInt cannot be called with new.

Formal Syntax & Structure

javascript syntaxjavascript
BigInt(value)

Parameters & Attributes

NameTypeDescription
valueanyValue convertible to an integer under BigInt conversion rules.

Return Value

bigint

Exact integer conversion result or an exception for invalid input.

Working Example

Example Snippetjavascript
console.log(String(BigInt("9007199254740993")));
JavaScript Reference