Skip to content

Instantly share code, notes, and snippets.

@marksalvin
Last active October 25, 2018 13:25
Show Gist options
  • Save marksalvin/71f3e6a5712a9e3e1853c78c35294955 to your computer and use it in GitHub Desktop.
Save marksalvin/71f3e6a5712a9e3e1853c78c35294955 to your computer and use it in GitHub Desktop.
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