Try executing the following in JavaScript:
parseInt(\'01\'); //equals 1 parseInt(\'02\'); //equals 2 parseInt(\'03\'); //equals 3 parseInt(\'04\'); //equals
Would it be very naughty to replace parseInt with a version that assumes decimal if it has no second parameter? (note - not tested)
parseIntImpl = parseInt parseInt = function(str, base){return parseIntImpl(str, base ? base : 10)}