Language types

Number language type

Try the free JavaScript compiler

Number represents IEEE 754 binary64 values including signed zeros, infinities and NaN. Fractions may round to the nearest representable value; safe integers have magnitude at most 2^53 − 1. Use safe-integer checks for bounded exact integer computations.

Formal Syntax & Structure

javascript syntaxjavascript
const amount = 2.5;

Working Example

Example Snippetjavascript
console.log(0.1 + 0.2);
JavaScript Reference