**Tell us what’s happening:**

My code running in Firefox gives correct results for all use cases

When i run in the Code Camp window, the last 2 use cases fail! I have been staring at this for hours:) - looking for some fresh eyes please

**Your code so far**

```
function smallestCommons(arr) {
// sort into ascending sequence
arr.sort((a,b)=> a - b);
// create array of numbers to test division
let rangeArr=[];
for (let i = arr[0]; i <= arr[1]; i++) {
rangeArr.push(i);
}
// set inital values
let foundDivCM=false;
let n1CM=arr[0];
let n2CM=arr[1];
// find divisible CM
while (!foundDivCM) {
// find next common multiplier
while (n1CM!==n2CM) {
if (n1CM<n2CM) {
n1CM+=arr[0];
} else {
n2CM+=arr[1];
};
};
// Check if all numbers are divisible for CM
let allDivisible=true;
for (let k = 0; k<rangeArr.length; k++) {
if (n1CM%rangeArr[k]!==0) {
allDivisible=false;
n2CM+=arr[1];
break;};
};
// If all divisible, return
if (allDivisible){console.log(n1CM);return n1CM;};
};
return arr;
}
smallestCommons([1,5]);
```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0`

.

**Link to the challenge:**

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