Hello! I had tried to solve the challenge a lot of times before I used the hint, but I can’t still understand how this code executes.Please help me to understand it.
function smallestCommons(arr) {
var max = Math.max(arr[0], arr[1]);
var min = Math.min(arr[0], arr[1]);
var mltple = max;
for(var i = max; i >= min; i--){
if(mltple % i !== 0){
mltple += max;
i = max;
}
}
return mltple;
}
smallestCommons([1,5]);