Ad
  • Default User Avatar

    I really don't understand this: const stringToNumber = str => ways.map(fn => fn(str)).reduce(checkThemAll)
    fn has to be a function with the parentheses, hasn't it?

  • Default User Avatar

    num % 10: to becom the last digit. Why 10? Because it concerns the decimal numbers which are represented from 0 to 9, so 10.

    • 48: to become the ASCII value from it. 48 is '0' untill 57 = 48 + 9 is '9'
      / 10: to the next digit

    We have to understand, there are various number systems, but the commun ones are: decimal (basis 10), binary (basis 2), octal (basis 8), Hexa (basis 16)