Finding L.C.M. in JavaScript
Akin to H.C.F., L.C.M. is commonly found by repeated factorization.
Only this time, the factors do not have to be common amongst the
set of numbers.
If we have the set of numbers 8, 12 and
18 for example, their L.C.M. is found thus:
Hence, L.C.M. of 8, 12 and 18 = 2 X 2 X 2 x 3 x 3 = 72