>> "If the radix provided is falsy, then by default, radix is set to 10."
The official docs for parseInt says this:
>> An integer between 2 and 36 that represents the radix (the base in mathematical numeral systems) of the string. Be careful — this does not default to 10. [1]
I just found it confusing whether the author meant the default value is 10, or if a falsy parameter (not undefined) turns out to be 10.
So looking at the rest of the documentation, the parameter not being set causes the default radix to be 10 unless the number starts with 0 or 0x, in which case they radix is 8 or 16 respectively. Though newer versions of JS no longer support the octal syntax (it likely just caused bugs for people who had initial zeros in their strings sometimes)
The official docs for parseInt says this:
>> An integer between 2 and 36 that represents the radix (the base in mathematical numeral systems) of the string. Be careful — this does not default to 10. [1]
I just found it confusing whether the author meant the default value is 10, or if a falsy parameter (not undefined) turns out to be 10.
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...