Smallest Common Multiple my code works in browser but not in fcc code editor

I’ve done Intermediate Algorithm Scripting: Smallest Common Multiple.
I’ve tested my code and it works on all test cases but when I paste it to fcc code editor it tells me that for smallestCommons([1, 13]) and smallestCommons([23, 18]) my code is not working.
Is my code wrong or is it issue with fcc?

function smallestCommons(arr) {
  let finalNum = 0;
  const range = [];

  arr.sort((a, b) => a - b);
  for (let i = arr[0]; i <= arr[1]; i += 1) {
    range.push(i);
  }

  function check(num) {
    if (range.every(el => num % el === 0)) {
      finalNum = num;
      return true;
    }
  }

  let count = 2;
  let number = 1;

  while (!check(number)) {
    number = arr[0] * count;
    count += 1;
  }

  return finalNum;
}

console.log(smallestCommons([1, 13])); // 360360
console.log(smallestCommons([23, 18])); // 6056820

The most likely answer is that you are running into problems with efficiency. FCC uses a timeout on code execution to protect against infinite loops (which will crash your browser). If a solution is particularly slow, it will sometimes not complete within the timeout period.

I guess you are right.