Hello,

Smallest Common Multiple

This is what I would like to do:

Whith this code , with the first loop in comment and with only one number passed in argument that works.:

```
function smallestCommons(n) {
//let max = Math.max(...arr);
//let min = Math.min(...arr);
//console.log(min)
const dividedBy = [[],[]]
//for (let n = min; n <= max; n++) {
/* I don't want to iterate over all the numbers so I'm only looking for prime numbers like in the previous exercise*/
//________________________________________________________________
let maxMultiple = Math.floor(Math.sqrt(n));
let numbers = [];
for (let l = 2; l <= n; l++) {
numbers.push(l);
}
for (let i = 2; i <= maxMultiple; i++) {
for (let j = Math.pow(i, 2) ; j <= n; j += i) {
if ( j !== false) {
numbers[j - 2] = false;
}
}
}
//console.log(numbers)
let primes = numbers.filter(item => Number.isInteger(item));
//_________________________________________________________________
primes.unshift(0,0)
console.log(primes)
let compte = 0;
dividedBy.push([0,0]);
console.log(dividedBy)
for (let k = 2; k <= primes.length; k++) { //for each number n in the first for loop, I decompose over each prime number.
if (n % primes[k] == 0) {
let n2 = n / primes[k];
compte += 1
n = n2;
k--;
}else{
dividedBy[dividedBy.length-1].push(compte)
compte = 0
}
}
console.log(dividedBy)
//}
}
smallestCommons([18]);
```

For `smallestCommons([18])`

the console return:

Great!!

But when I add the first for loop, with `smallestCommons([9,18])`

there is a infinity loop:

```
function smallestCommons(arr) {
let max = Math.max(...arr);
let min = Math.min(...arr);
console.log(min)
const dividedBy = [[],[]]
for (let n = min; n <= max; n++) {
/* I don't want to iterate over all the numbers so I'm only looking for prime numbers like in the previous exercise*/
//____________________________________________________________________
let maxMultiple = Math.floor(Math.sqrt(n));
let numbers = [];
for (let l = 2; l <= n; l++) {
numbers.push(l);
}
for (let i = 2; i <= maxMultiple; i++) {
for (let j = Math.pow(i, 2) ; j <= n; j += i) {
if ( j !== false) {
numbers[j - 2] = false;
}
}
}
//console.log(numbers)
let primes = numbers.filter(item => Number.isInteger(item));
//__________________________________________________________________
primes.unshift(0,0)
console.log(primes)
let compte = 0;
dividedBy.push([0,0]);
console.log(dividedBy)
for (let k = 2; k <= primes.length; k++) { //for each number n in the first for loop, I decompose over each prime number.
if (n % primes[k] == 0) {
let n2 = n / primes[k];
compte += 1
n = n2;
k--;
}else{
dividedBy[dividedBy.length-1].push(compte)
compte = 0
}
}
console.log(dividedBy)
}
}
smallestCommons([9,18]);
```

I need help