Tell us what’s happening:
Your code so far
function smallestCommons(arr) {
if(iterate === 0) {
iterate = 1;
} else {
iterate = (iterate / a) + 1;
}
while( a * iterate % b !== 0) {
console.log(iterate);
iterate++;
}
return a * iterate;
}
smallestCommons([1,5]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36
.
Challenge: Smallest Common Multiple
Link to the challenge: