how to write a function that computes the gcd of 2 positive intergers javascript code example
Example: javascript gcd
const gcd = (a, b) => b === 0 ? a : gcd(b, a % b);
// Example
gcd(10, 15); // 5
const gcd = (a, b) => b === 0 ? a : gcd(b, a % b);
// Example
gcd(10, 15); // 5