I'll appreciate any help with js cert: Intermediate scripting

I’m doing the js certification on the main FCC. I’m going throught the Intermediate Algorithm Scripting: Smallest Common Multiple .

My code.

So… the solution i made gets the correct result on every test on the chrome console. But the last test keeps showing as failed on FCC. Am i missing something here? because at least in the console it shows the correct test output…

I’ll depply appreciate any idea (i’ve been stuck on this for two days already).


If your code is inefficient it will take long enough to execute that it will trigger FCC’s infinite loop protection before it completes.

I guess that’s what it is. Thanks!