Intermediate Algorithm Scripting - Binary Agents

This is FCC solution. I want to know why did they wrote 2 after biString[i];

ParseInt(biString[i], 2)));

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15

Challenge Information:

Intermediate Algorithm Scripting - Binary Agents

The code is essentially converting each character of the binary string biString into an integer using a radix of 2, which is why the 2 is written after biString[i] in the code.

What is 2 radix?

And thank you for taking your time to help me

The radix is an integer between 2 and 36 that represents the base in mathematical numeral systems.
If the radix is 2, the string is interpreted as a binary number, and if the radix is 16, the string is interpreted as a hexadecimal number. The radix parameter is optional, and if it is not specified, the function assumes a default value of 10
Understanding the Radix

1 Like

Thanks thanks thanks

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.