Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. var x = 010;
  2. console.log(x); //8
  3.  
  4. Decimal integer literal consists of a sequence of digits without a leading 0 (zero).
  5. 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.
  6. Leading 0x (or 0X) indicates hexadecimal. Hexadecimal integers can include digits (0-9) and the letters a-f and A-F.
  7. Leading 0b (or 0B) indicates binary. Binary integers can include digits only 0 and 1.
  8.  
  9. 0, 117 and -345 (decimal, base 10)
  10. 015, 0001 and -0o77 (octal, base 8)
  11. 0x1123, 0x00111 and -0xF1A7 (hexadecimal, "hex" or base 16)
  12. 0b11, 0b0011 and -0b11 (binary, base 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement