Literals

Number literal

Try the free JavaScript compiler

Numeric literal notation can represent Number values. Ordinary decimal notation has no quotation marks. Other forms include hexadecimal, binary, octal and exponent notation; integer precision is limited by the Number representation.

Formal Syntax & Structure

javascript syntaxjavascript
42

Return Value

number

Numeric value expressed by the literal.

Working Example

Example Snippetjavascript
console.log(42);
JavaScript Reference