This is of course made with the assumption that you are trying to use the "Counting" or base 10 numbering system.
Essentially if the string you're trying to parse into an integer has the possibility of a leading zero. E.g "010", which would be an octal and would be treated as such by default, meaning what you would get back is the binary equivalent which turns out to be: 2.
The radix parameter establishes which base number system you want to use so that you don't end up using the octal system by default. This could also be helpful if you are intentionally trying to use the other number systems like hexadecimal and such. (e.g. parseInt("0x01",16) which would output: 00000001).
Normally you want to just use the counting numbering system or base 10 in which case you just set the radix parameter to 10.
parseInt("-15", 10) = -15
parseInt("-0xF",16) = -15
parseInt("001 101", 8) = -15
parseInt("-17", 8) = -15
so, on and so forth.
To read more on the subject Mozilla does a splendid job of explaining further.
|Computers||CSS||Food||Games||Gear||Hardware||Health||HTML||Humor||jQuery||Laptops||Mobile||Movies||Music||MySQL||News||Online Service||Operating System||Peripherals||Pets||PHP||Random||Software||Sports||TV Shows||Unsorted||Vlog|