JavaScript Program to Find GCD or HCF of Two Numbers
GCD (Greatest Common Divisor) or HCF (Highest Common Factor) of two numbers is the largest positive integer that divides both numbers without leaving a remainder. GCD ( a, b ) = [ |a.b| ] / [ lcm(a, b) ]or,HCF of factors = Product of the Numbers/ LCM of numbersExample: Input: a = 20, b = 28Output: 4