Converting binary to a number

Hi guys,
Does anyone know how to convert from binary to a number?

function convertToInteger(str) {
  
}

convertToInteger("10011");

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function-with-a-radix

Thanks a lot!
It was very helpful :slight_smile:

I was wondering the same thing. I really didn’t know how to do this, but fortunately I have found this thread, and now I know about parseInt() function. Thank you so much for your answer, it was very useful. Now I know how to convert binary to a number. By the way, after converting I got the number 511. I have read on https://www.sunsigns.org/angel-number-511-meaning/ that it’s more than just a simple number, it has something special, a hidden meaning, and it’s a sign. Maybe it’s just a coincidence, but I believe that it’s not. However, thank you for your answer, it was very useful.