jslint Missing radix parameter.

The javascript function parseInt takes two parameters. The first parameter is the string and the second parameter is the radix. The string is the string that you want to convert to an int. The radix is the an integer between 2 and 36 that represents the base in mathematical numeral systems of the string parameter. By default, if the starts with a digit expcet 0, it will assume it’s an decimal number, if it starts with 0X, it will assume it’s a hexadecimal. However, the best practice is don’t omit the radix to avoid confusion and to guarantee an expected result. In jslint, if you call the parseInt without the radix parameter, it will give you the warning msg Missing radix parameter.

parseInt("123");

It will be fine if you call the parseInt with the radix.

parseInt("123", 10);

Search within Codexpedia

Custom Search

Search the entire web

Custom Search