Try executing the following in JavaScript:
parseInt(\'01\'); //equals 1 parseInt(\'02\'); //equals 2 parseInt(\'03\'); //equals 3 parseInt(\'04\'); //equals
From the parseInt documentation, use the optional radix argument to specify base-10:
parseInt('08', 10); //equals 8 parseInt('09', 10); //equals 9
This strikes me as pedantic, confusing, and verbose (really, an extra argument in every single parseInt?) so I'm hoping there is a Better Way.