Sum of digits challenge

I am solving codewars challenge and I have one failed test which is:
image

So the failed test is existing when input is 0 (number data type)

THE LINK TO THE CHALLENGE:

I was concerned that 0 might not have been valid, but the task is to sum up all of the digits in a number so this is completely valid.

Do you notice where your code starts to go wrong when 0 is being used?

or perhaps more to the point, how are you currently solving the challenge? I can envision multiple routes that might lead to this problem.

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