We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f0be4b commit 33129f0Copy full SHA for 33129f0
JavaScript/9-gcd.js
@@ -0,0 +1,10 @@
1
+'use strict';
2
+
3
+const gcd = (a, b) => {
4
+ if (b === 0) return a;
5
+ return gcd(b, a % b);
6
+};
7
8
+// const gcd = (a, b) => (b === 0 ? a : gcd(b, a % b));
9
10
+console.log(gcd(12, 78));
0 commit comments