Smallest Common Multiple - last criteria

Ok, so the below code works for all test criteria but the last one, when I run the test on fcc, it fails the call to array points [23,18]. BUT…if I put my code into a jfiddle, the number matches actually to the expected test result. So how can my code work in a jsfiddle, but not fcc?? Here’s my code (and yes not elegant, but I’ve been on this challenge for a while and just wanted a working solution.)

function numRangeArray(start, end){
  var myArr = [];
  for(var i = start; i >= end; i--){
    myArr.push(i);
  }
  return myArr;
}

function smallestCommons(arr) {
  if(arr[0] > arr[1]) {arr = numRangeArray(arr[0], arr[1]);}
  else {arr = numRangeArray(arr[1], arr[0]);}
  //arr is not sorted high to low with all numbers in range
  
  var smallestCommonMultiple = 0;
  var index= 1;
  while(smallestCommonMultiple === 0){
    var temp = arr[0] * index;
    var counter = 0;
    for(var j = 0; j < arr.length; j++){
    	if(temp % arr[j] === 0){
      	counter++;
      } else if(temp % arr[j] !== 0){
      	break;
      }
     }
     if(counter === arr.length){
     	smallestCommonMultiple = temp;
     } else {
     	index++;
     }
    }
    console.log("Smallest: " + smallestCommonMultiple);
  return smallestCommonMultiple;
}