Lexical syntax

BigInt literal

Try the free JavaScript compiler

An integer literal followed by n denotes a BigInt. Valid forms include decimal and supported binary, octal and hexadecimal integer forms. Fractional and exponent-form literals with n are invalid. A leading minus is a unary operator, not part of the literal.

Formal Syntax & Structure

javascript syntaxjavascript
123n

Working Example

Example Snippetjavascript
console.log(String(0x10n));
JavaScript Reference