Skip to content
Subhajit Sahu edited this page Aug 9, 2022 · 2 revisions

Find the least common multiple of numbers.

Similar: gcd, lcm.


function lcm(...xs)
// xs: a list of numbers

const xnumber = require('extra-number');


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

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

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


References

Clone this wiki locally