LCM

PHOTO EMBED

Sat Dec 04 2021 00:19:24 GMT+0000 (Coordinated Universal Time)

Saved by @tolanisirius

function lcm(a, b) {

  let small = Math.min(a,b);
  let large = Math.max(a,b);
  let i = 0;

  do {
   i += large;
      
    
  } while (i % small !== 0)

  return i;
}
lcm(4, 6);
content_copyCOPY

https://www.jshero.net/en/koans/dowhile.html