DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
sum of digits in a whole number javascript
sum = 0; while (value) { sum += value % 10; value = Math.floor(value / 10); }
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#sum
#digits
#number
#javascript
ADD COMMENT
Topic
COMMENT
Name
7+4 =
Submit