Answers for "find the sum of digits in a number with function in js"

1

sum of digits in a whole number javascript

sum = 0;
while (value) {
    sum += value % 10;
    value = Math.floor(value / 10);
}
Posted by: Guest on August-26-2021

Code answers related to "find the sum of digits in a number with function in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language