The browser storage localStorage is not available. Either your browser does not support it or you have disabled it or the maximum memory size is exceeded. Without localStorage your solutions will not be stored.

gcd

The counterpart to the least common multiple is the greatest common divisor (gcd). The greatest common divisor of two natural numbers a and b is the largest natural numbers that divides a and b.

Exercise

Write a function gcd that takes two natural numbers and calculates their gcd. gcd(6, 15) should return 3.