Radix, parseInt and the result value

I would suggest reading through this math is fun article and watching this YouTube video on binary

That will explain how binary works.

But also looking at a visual might help.

Let’s take a look at this example I created here.

The first thing to understand are the place values.
As you can see we have a 1’s place, 2’s place, 4’s place, 8’s place, etc.
It goes all the way up to 128’s place.

Here are where the place values come from

20 equals 1
21 equals 2
22 equals 4
etc…

All of that is explained in the resources I linked.

Once you understand the place values then it is just about placing the 1’s and 0’s in the correct places.

If you want to find what 3 is in binary then you place a 1 in the 1’s place and a 1 in the 2’s place.

1+2 = 3 :grinning:

You can follow that same process for any number.

For example if you wanted to know what the number 13 is in binary.

It really boils down to adding up the appropriate values to get the number you are looking for.

Hope that helps!