Is My Lowest Common Multiple Solution..too messy?

So I did struggle with this for a little while, i thought it was going to be more straightforward but I ran into a snag with the for loop I used to iterate numbers for (x=1;x<10000000;x++) to check against the range array.

I was thinking that setting a hard limit of 10,000,000 seemed arbitrary except to meet the requirements of the puzzle, but then i got to thinking, shouldn’t there be a limit? How much processing time would it take to check up to a trillion numbers?

As always your feedback is appreciated greatly.


function smallestCommons(arr) {
 range = []; 
 var min = arr[0], max = arr[1];
 }//sequenced range in ascending order
 for (x=1;x<10000000;x++){
      if(x % range[i] !== 0){
     if (range[i] == max){
       return x;
     }//check if x will pass through to last element in sequence(max) 
 function ascending(a,b){
   return a-b;
 return range;