## Intermediate Algorithm Scripting: Smallest Common Multiple

**Your code so far**

```
//noprotect
function smallestCommons(arr) {
var start = Math.min(arr[0],arr[1]);
var end = Math.max(arr[0],arr[1]);
var range = [];
for (var i= start; i<=end ; i++)
{
range.push(i);
}
var LCM = 0,
flag = true;
while(flag){
LCM++;
for (var j= start; j <= end;j++){
if(LCM % j !==0){
break;
}
else if (j===end){
flag = false;
}
}
}
return LCM;
}
```

i checked my code work well with console but i couldnâ€™t pass the last 2 questions even i added //noprotect in first line.

could anyone give me some advise on it? thanks in advance