Skip to content

Instantly share code, notes, and snippets.

@solowt
Last active February 19, 2016 00:55
Show Gist options
  • Save solowt/032bc3e3661576da02c2 to your computer and use it in GitHub Desktop.
Save solowt/032bc3e3661576da02c2 to your computer and use it in GitHub Desktop.

#Binary and Octal Literals In in ES5, hexadecimal numbers can be represented with 0x in front of the number:

console.log(0xFFFFF);

Now, in ES6, a similar feature has been added for binary and octal numbers:

console.log(0b1010101); //parseInt(1010101, 2); es5 version
console.log(0o0123147); //parseInt(0123147, 8); es5 version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment