JS: Number
Number Type
Number is a type of Primitive Value
No Distinction of Integer and Float
In js, there is no distinction of integer and float. They are just number type.
console.log(typeof 3 === "number"); // true console.log(typeof 3.2 === "number"); // true
Decimal Number Syntax
console.log( 123 ) console.log( 123. ) console.log( 123.0 ) console.log( 123.45 )
Number Separator
Numbers can have separator lowline _
between digits.
console.log(1_000 === 1000);
Input Binary, Hexadecimal, Octal, Scientific
NaN and Infinity
Number value also includes
NaN
and
Infinity
JavaScript. Number
- JS: Number
- JS: Number Input. Binary, Hexadecimal, Octal, Etc
- JS: Assignment Operators
- JS: Math Operators
- JS: Number Comparison Operators
- JS: Convert String and Number
- JS: Convert Decimal, Hexadecimal
- JS: Convert Decimal, Binary
- JS: Format Number
- JS: Random Integer Range Function 📜
- JS: Number (class)
- JS: Number Constructor
- JS: Number.prototype
- JS: Math (namespace)