lcm - nodef/extra-math GitHub Wiki

Find the least common multiple of numbers.

Similar: gcd, lcm.

function lcm(...xs)
// xs: a list of numbers
const xmath = require('extra-math');


xmath.lcm(2, 3);
// → 6

xmath.lcm(2, 3, 4);
// → 12

xmath.lcm(2, 3, 4, 5);
// → 60

References