IE8: parseInt('07') vs parseInt('08') [duplicate]
Asked Answered
A

1

6

Found out a strange thing in IE8:

parseInt('01')
//1
parseInt('02')
//2
parseInt('03')
//3
/*...*/
parseInt('07')
//7
parseInt('08')
//0 !!!
parseIntr('09')
//9 ok

Can someone clarify?

Alcoholism answered 26/9, 2013 at 15:41 Comment(2)
you forgot to use a radixDunghill
All right, using radix heps. Can someone post the answer so I could mark it as answer.Alcoholism
A
9

Use radix

parseInt('08', 10)
//8
Alcoholism answered 27/9, 2013 at 5:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.