Deviopath › JavaScript

Sum of Digits

Easy · Loops

Write a function sumDigits that returns the sum of the digits of a whole number. For negative numbers, ignore the minus sign.

Next: Factorial