Number Literals
Default / Decimal
Numbers are in most cases just represented as the decimal value.
let exampleNumber = 123; // 123
Binary
You can also represent numbers in binary form. To do that you have to prefix the number with 0b
.
let exampleNumber = 0b101010; // 42
Hexadecimal
You can also represent numbers in hexadecimal form. To do that you have to prefix the number with 0x
.
let exampleNumber = 0x2a; // 42