IE8: parseInt ('07 ') vs parseInt (' 08 ')

IE8 discovered a strange thing:

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

Can someone clarify?

+6
source share
1 answer

Use radix

 parseInt('08', 10) //8 
+9
source

Source: https://habr.com/ru/post/954695/


All Articles