Need help with radix

Need help with radix
0.0 0

function convertToInteger(str) {
  var num = parseInt(str, 3);
  return num;

convertToInteger("10011"); // returns 19
convertToInteger("111001"); // returns 57

So I understand everything about this code except of radix. It has to be value between 2 and 36 but what’s base value and how does it correspond to the string input?


Hi lyrs13,

The tests:


Clue: the tests are in binary form (2).

Happy coding! :smiley:


Base is the numbering system base (so binary is base 2, decimal is base 10). So with parse int, you’re saying look in a string for a number in the given numbering system, and convert it to a decimal integer.