**This piece of code generates random values in FCC console.**

Would you help me to find out why this code generates random values for a specific test in FFC console but works correctly everywhere outside?

The failed test is written at the end.

```
function smallestCommons(arr) {
arr.sort((a,b)=>a>b);
let newArr = [];
for(let i = 0; i <= arr[1] - arr[0]; i++) {
newArr.push(arr[0] + i);
}
let found = false;
let result = arr[1];
while(!found) {
found = newArr.every(x => (result % x) == 0);
if(!found) result++;
}
return result;
}
console.log(smallestCommons([23,18]));
```

**Browser information:**

User Agent is: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36`

.

**Link to the challenge:**

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