Weird bug with FCC Challenge

I was doing the Smallest Commun Multiple challenge and then I got this weird bug with my code. My code works just fine when I put it in the browser dev tool, but when I try to run from FCC page it always gives me random output, and I’m not allowed to finish the challenge because of that

here is my code

function smallestCommons(arr) {
  const minorLimit = Math.min(...arr)
  const majorLimit = Math.max(...arr)
  let num = majorLimit - 1
  let boolFlag = []
  do{
    boolFlag = []
    num++
    for(let i = minorLimit; i<= majorLimit; i++){
      boolFlag.push(num%i===0?1:0)
    }
  }while(boolFlag.indexOf(0)>=0)
  return num;
}


console.log(smallestCommons([23,18]));

the output, in this case supposed to be 6056820, but instead I just receive random values everytime I change anything on my code from FCC Page code runner.

One more thing: I tried to deactivate the infinity loop protection by writing ```` //noprotect ``` in the beginning of my code but unfortunately it still doesn’t worked

The algorithm you have chosen to use is not efficient enough and as a result triggers the infinite loop protection FCC current has. The //noprotect no longer works in the curriculum version. You need to rethink your loop logic to increase efficiency.