Programación de algoritmos intermedios - Mínimo común múltiplo

Cuéntanos qué está pasando:
¿Alguien me puede explicar la setencia if dentro del bucle for?

  **Tu código hasta el momento**
function smallestCommons(arr) {
let min = Math.min(arr[0], arr[1])
let max = Math.max(arr[0], arr[1])
let result = max

for (let i = max; i >= min; i--) {
  if (result % i !== 0) {
    result += max
    i = max
  }
}
return result
}

console.log(smallestCommons([1,5]));
  **Información de tu navegador:**

El agente de usuario es: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36 OPR/90.0.4480.84

Desafío: Programación de algoritmos intermedios - Mínimo común múltiplo

Enlaza al desafío:

I strongly recommend against looking up the solutions until you solve the problem. Have you solved this challenge yet?