New number and Math features in ES6
This blog post describes the new number and Math features of ECMAScript 6 . Overview You can now specify integers in binary and octal notation: > 0xFF // ES5: hexadecimal 255 > 0b11 // ES6: binary 3 > 0o10 // ES6: octal 8 The global object Number gained a few new properties. Among others: Number.EPSILON for comparing floating point numbers with a tolerance for rounding errors. A method and constants for determining whether a JavaScript integer is safe (within the signed 53 bit range in which there is no loss of precision). New integer literals ECMAScript 5 already has literals for hexadecimal integers: > 0x9 9 > 0xA 10 > 0x10 16 > 0xFF 255 ECMAScript 6 brings two new kinds of integer literals: Binary literals have the prefix 0b or 0B : > 0b11 3 > 0b100 4 Octal literals have the prefix 0o or 0O (yes, that’s a zero followed by the capital letter O; you’ll be fine if you use the first...