Use the parseint function with a radix

I was confused with parseInt(): hex, otcal, and binary and after all youtube and gooling, I found w3 school has helpful information. Hope it helps :smile:
https://www.w3schools.com/jsref/jsref_parseint.asp
I think you can dive in from there :wink:

You are really doing a good job here…thanks for your patience and time.

Thanks for this answer sir, and your following answers. I must admit I was very stumped with what a Radix was, but doing basic research on Binary as per your recommendations has made the task at hand clearer.

For those who still don’t understand, the Radix needing to be 2 to pass the test is simply because binary operates in two settings, 1 or 0. Any higher level of Radix, say 3, would allow 2, 1 and 0 and thus the pass terms for the exercise wouldn’t work.

Would also recommend these two resources:
5 min video on Binary - https://www.youtube.com/watch?v=LpuPe81bc2w
Binary conversion - https://www.rapidtables.com/convert/number/binary-to-decimal.html

As a general recommendation to improve the resource I would recommend that some of the mathematical elements are hyperlinked in, or at least a warning be noted that certain prior learning may need to be undertaken.

I appreciate you say most of this may have been done in school and may not be remembered but as far as my own memory goes this barely registers and people drop out of mathematical education at varying stages. I think there’s an extent to which warnings about required knowledge might help people who are cycling through tutorials without fully understanding them, as I have been guilty of myself.

Thanks for the full explanation in this thread though, very satisfied to have put it all together!

function convertToInteger(str) {

  var conversor = parseInt(str, 2);

  return conversor;

}

convertToInteger("10011");

It worked !