I’m having a similar problem, although when I run the code in a browser or in VSCode, I get 6056820 as the answer, which is correct. Every test but the last one passes. Here’s my code:
function smallestCommons(arr) {
let a = Math.min(...arr), b = Math.max(...arr), test = true;
for (let i = 1; ; i++) {
if ((i % a == 0) && (i % b == 0)) {
for (let j = a; j <= b; j++) {
if (i % j == 0) test = true;
else {
test = false;
break;
}
}
if (test) return i;
}
}
}