function smallestCommons(arr) {
let found = false;
let counter = 2;
arr.sort((a,b) => (a - b));
while (found == false){
for(let i = arr[0]; i <= arr[1]; i++){
if(counter % i != 0){
counter++;
break;
}
if(i == arr[1]){
found = true;
}
}
}
return counter;
}
console.log(smallestCommons([23,18]));
i believe you are running into the FCC ‘infinite loop’ prevention because it takes too long to complete. If you search the forum you can find other posts similar to yours and see how others handled the same situation. (there is a workaround you may try or you can rewrite the code to be more efficient)