Use the parseInt Function with a Radix -- explanation needed

Use the parseInt Function with a Radix -- explanation needed
0.0 0

#1

Tell us what’s happening:

I’m completely lost on this one.

What is a radix?
What is the base of a number?
What does the following line mean?

The radix variable says that “11” is in the binary system, or base 2. This example converts the string “11” to an integer 3.

Your code so far


function convertToInteger(str) {
  return parseInt(str, 2);
}

convertToInteger("10011");

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 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


#2

So we normally use decimal, which is base 10, for most things in day to day life (with exceptions, eg time, which is base 60). So parseInt takes a string and makes an attempt to turn it into a number, but you can pass in a base (radix) which specifies the base, and it will give you an integer back.


#3

How does this convert to 3?


#4

Because 3 is 11 in binary