Hey y’all, here is my code for the smallest common multiple. I am now changing this to instead be a loop, but I am just wondering why this doesn’t work. Was interested in trying it via recursion, so had gone this route.

If I’m understanding it correctly, it inevitably should work, but I’m guessing it is taking too much time. I’m instead going to craft a loop using similar language, but some comments would be appreciated. Many thanks!

```
function smallestCommons(arr) {
// Setting maximum value of the array
var max = arr.reduce(function (a, b) {
return Math.max(a, b);
});
// Setting minimum value of the array
var min = arr.reduce(function (a, b) {
return Math.min(a, b);
});
// function will constantly check all other necessary values against array's max
function recursiveSearch(multiple) {
var m = max - 1;
while (m >= min) {
if (multiple % m !== 0) {
return recursiveSearch(multiple + max);
}
else {
m--;
}
}
return multiple;
}
return recursiveSearch(max);
}
smallestCommons([1,10]);
```