In a recent problem I was working on, I was parsing the individual ones and zeroes representing the bits of a binary number, and assigning them to variables. I quickly ran into something I didn’t expect.
While prefixing zeros is not something you should be doing, especially when declaring a variable, this automatic assignment may cause you a quick headache as well someday. Luckily, this type of integer assignment is officially discouraged. As of ECMAScript 5, this type of integer assignment throws an error in strict mode.
If you do want to declare a variable as a specific base number, ECMAScript 6 offered a smarter solution for that. Now you can prefix numbers to indicate what type of number they represent.