Hi there,

I am struggling hard with this challenge, after cruising through all the previous challenges, the past 3 have been really challenging to the point where I am doubting about what I thought I know…

I tried to simplify this challenge by solving it by pieces. After finding a math formula to find the lcm ( LCM(a,b) = (a*b)/GCD(a,b) ), i succeeded to make it work but only for 2 numbers.

```
function smallestCommons(arr) {
function remainder(a, b){
if (a === 0){
return b;
}
while (b !== 0){
if (a > b)
a = a - b;
else
b = b - a;
}
return a;
}
var cgd = remainder(arr[0], arr[1]);
var lcm = (arr[0]*arr[1])/cgd;
return lcm;
}
console.log(smallestCommons([12, 30]));
```

After doing that I thought that i will just have to implement a loop somehow to go through the range and pass every number, but I can’t figure how to do so. I keep looking at the solution of other people and can hardly understand them.

I am clearly lacking a great dose of logic on this one and I could use some help on how to get to the next step!

Thank you!