6. Octal and Binary Literals

ES6 has new support for octal and binary literals.
Prependending a number with 0o or 0O would convert it into octal value. Have a look at the following code:

  1. let oValue = 0o10;
  2. console.log(oValue); // 8
  3. let bValue = 0b10; // 0b or 0B for binary
  4. console.log(bValue); // 2