**Tell us what’s happening:**

The code below can find the smallest common multiple up to [1, 15]. It will not function after it gets to more than [1, 16]

if I take away the if ( y % min == 0 &&; y % max == 0 ) condition on line 8 and tweak the for loop to include min and max number in the array. I will not function after [1,13]

It would like to know is this the problem of my code or the code execution reaches the limit of the output because there are too many loops going on? I don’t get it how my code is not correct after reaching a certain number parameter. The code should work in all numbers.3

**Your code so far**

```
function smallestCommons(arr) {
let max = Math.max(arr[0], arr[1]);
let min = Math.min(arr[0], arr[1]);
let i = 0;
let y = 1;
while (i < 1){
let k = 0;
if ( y % min == 0 && y % max == 0 ){
for (let x = min+1; x< max; x++){
if (y % x == 0 ){
k++;
}
}
}
if (k == (max - min -1)) {
i++;
return y;
}
else {
y++
}
}
}
console.log(smallestCommons([2, 14]));
```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36`

.

**Link to the challenge:**

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/smallest-common-multiple