
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
JSLint Error: Missing Radix Parameter in JavaScript
The parseInt function available in JavaScript has the following signature −
parseInt(string, radix);
Where the parameters are the following −
string − The value to parse. If this argument is not a string, then it is converted to one using the ToString method. Leading whitespace in this argument is ignored.
radix − An integer between 2 and 36 that represents the radix (the base in mathematical numeral systems) of the string.
If the radix parameter is omitted, JavaScript assumes the following −
If the string begins with "0x", the radix is 16 (hexadecimal)
If the string begins with "0", the radix is 8 (octal). This feature is deprecated
If the string begins with any other value, the radix is 10 (decimal)
In order to avoid the above magic, JShint gives an error.
Advertisements