Answers for "how to make a function which calculates the digit sum of an integer 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 "how to make a function which calculates the digit sum of an integer in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language