Try executing the following in JavaScript:
parseInt(\'01\'); //equals 1 parseInt(\'02\'); //equals 2 parseInt(\'03\'); //equals 3 parseInt(\'04\'); //equals
This is a common Javascript gotcha with a simple solution:
Just specify the base, or 'radix', like so:
parseInt('08',10); // 8
You could also use Number:
Number('08'); // 8