DEV Community

Discussion on: Remembering that "functions are objects" can help in writing more concise code

 
robertcoopercode profile image
Robert Cooper

From MDN (radix being the same as base with the previously used verbage):

If radix is undefined or 0 (or absent), JavaScript assumes the following:

  • If the input string begins with "0", radix is eight (octal) or 10 (decimal). Exactly which radix is chosen is implementation-dependent. ECMAScript 5 specifies that 10 (decimal) is used, but not all browsers support this yet. For this reason always specify a radix when using parseInt.
Thread Thread
 
somedood profile image
Basti Ortiz

Thanks for looking into this! We appreciate your efforts. I'll go make a quick edit to the article now to raise this point.