The "Missing radix parameter" error is thrown when JSLint, JSHint or ESLint
encounters a call to the
parseInt function that only has one argument. As
of JSHint 2.3.0 the warning will only be issued if the
es3 option is set to
true. Here's an example:
This error is raised to highlight a potential oversight that could lead to
problems. The second argument of the
parseInt function is used to specify a
radix. If no radix is specified, the function can return suprising results. If
the string begins with a
0 it will be interpreted as an octal (base 8) number.
parseInt("010") will return
8, and not
10. This behaviour was
allowed by the ECMAScript 3 specification. However, here's what the ECMAScript 5
specification has to say (ES5 §126.96.36.199:
parseIntfunction produces an integer value dictated by interpretation of the contents of the string argument according to the specified radix. Leading white space in string is ignored. If radix is undefined or 0, it is assumed to be 10 except when the number begins with the character pairs
0X, in which case a radix of 16 is assumed.
As of ECMAScript 5, this quirk of
parseInt has been removed. However, since
it's likely you will want your code to run successfully in older environments
that do not support ES5, you should always pass a radix to
In JSHint 1.0.0 and above you have the ability to ignore any warning with a
special option syntax. The identifier of this warning is W065.
This means you can tell JSHint to not issue this warning with the
-W065 */ directive.