like on this post I wanted to get the sum of a number digits using reduce
but when I checked google I found other ways to do so, one of these ways was
var value = 2568,
sum = 0;
while (value) {
sum += value % 10;
value = Math.floor(value / 10);
}
console.log(sum);
now how to do this on one line as return