Tell us what’s happening:
This code works fine in other IDE but not in FCC, Why?
Your code so far
function smallestCommons(arr) {
let num=1;
while(true){
let confirm=1;
for(let start=Math.min(...arr),end=Math.max(...arr);start<=end;start++){
if(num%start!=0){
confirm=0;
break;
}
}
if(confirm==1){
// console.log(num)
return num;
}
num++;
}
}
console.log(smallestCommons([1,13]));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/smallest-common-multiple