JS: Number

By Xah Lee. Date: . Last updated: .

Number Type

Number is a type of Primitive Value

In js, there is no distinction of integer and float. They are just number type.

typeof 3 === "number"

typeof 3.2 === "number"

Number Literal Syntax

Binary, Hexadecimal, Syntax

Number Separator

Numbers can have separator lowline _ between digits.

1_000 === 1000

NaN and Infinity

Number value also includes NaN and Infinity

JavaScript, Number

BUY ΣJS JavaScript in Depth