Created
December 17, 2015 13:10
-
-
Save ohaal/e7bbd5346468cc88fdc9 to your computer and use it in GitHub Desktop.
Algorithm for looping over a numbers' single digits one by one without using strings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var numberAlone; | |
while (number !== 0) { | |
numberAlone = num % 10; | |
number = Math.floor(number / 10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment