const number = parseInt('100'); number; // 100
'100' is parsed to integer
parseInt(numericalString, radix) also accepts a second argument: the radix at which the numerical string argument is. The radix argument allows you to parse integers from different numerical bases, the most common being 2, 8, 10, and 16.
parseInt() to parse a numerical string in base 2:
const number = parseInt('100', 2); number; // 4
parseInt('100', 2) parses
'100' as an integer in numerical base 2: thus it returns the value
4 (in decimal).
That’s pretty much a short introduction to
What is PHP: - Who invented PHP, how it works, answers to all such questions about PHP, and much other information, you are going to