Question: how to find greatest common divisor in javascript?
Answer: var gcd = function(a, b) {
if ( ! b) {
return a;
}
return gcd(b, a % b);
};
console. log(gcd(2154, 458));