ParseInt () method in Js

Why is the result NaN, instead of 11.

parseInt (09prime8) and parseInt (0x9pjin8)
Mar.13,2021

this kind of problem is suggested to refer to some better documents,

clipboard.png from mdn-parseInt .


because 09 is not a valid octal number, and 0x9 is not

The first parameter of

parseInt is of type string. If not, ToString will be used for conversion


0x9 = > 9 (Number) = > "9" (String)
but there is no 9 in octal. "9" is not a correct expression of octal. "9" does not exist in octal


9 > where is 9 in octal

Menu