JS: Number
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
123
→ number123.
→ number123.0
→ number123.45
→ number
Binary, Hexadecimal, Syntax
0xff
→ hexadecimal notation0b11
→ binary notation9e2
→ scientific notation. same as 900
Number Separator
Numbers can have separator lowline _
between digits.
1_000 === 1000
NaN and Infinity
Number value also includes
NaN
and
Infinity