MENU
Binary and Octal Literals
Recently, binary, octal, and hexadecimal literals have been supported in JavaScript. Such literals begin with 0 and are internally integers.
RESETRUNFULL
<!DOCTYPE html><html><body><script>
console.log(0b001 === 1); // true
(binary)
console.log(0o10 + 1); // 9
(octal)
console.log(010); // 8
(octal)
console.log(0xff); // 255
(hex)
console.log((0xff).toString(16)); // ff
(hex)
</script></body><html>