-
-
Save marksalvin/71f3e6a5712a9e3e1853c78c35294955 to your computer and use it in GitHub Desktop.
This file contains 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
const greatestCommonDivisor = (a, b) => { | |
while (a !== b) { | |
if (a > b) { | |
a -= b; | |
} else if (b > a) { | |
b -= a; | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment