Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var x = 010;
- console.log(x); //8
- Decimal integer literal consists of a sequence of digits without a leading 0 (zero).
- Leading 0 (zero) on an integer literal, or leading 0o (or 0O) indicates it is in octal. Octal integers can include only the digits 0-7.
- Leading 0x (or 0X) indicates hexadecimal. Hexadecimal integers can include digits (0-9) and the letters a-f and A-F.
- Leading 0b (or 0B) indicates binary. Binary integers can include digits only 0 and 1.
- 0, 117 and -345 (decimal, base 10)
- 015, 0001 and -0o77 (octal, base 8)
- 0x1123, 0x00111 and -0xF1A7 (hexadecimal, "hex" or base 16)
- 0b11, 0b0011 and -0b11 (binary, base 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement