Possible Duplicate:
Workarounds for JavaScript parseInt octal bug
I am working on javascript, and I seem to find this strange, that the javascript function parseInt('08') is returning 0 and parseInt('07') is returning 7.
this behavior seems to be there in Firefox.
parseInt('08') is returning 8 in IE, but 0 in Firefox..
Why? I want parseInt('08') to return 8, as expected and getting in IE.
parseInt('08', '10');
? Really? Usually we will just do+"08"
, since adding+
in front of a String will turn it into Number without any problem. – Redneck