I was trying to use a Sieve of Eratosthenes snippet from one of my favorite snippet repositories (rosettacode.com) and the code works as intended in dev tools (tried a couple browsers to make sure), but when I run it in the FCC tool it only works up to submitting 15 as the argument after that I get an infinite loop message. I’ve walked through it a couple times but I just can’t figure out the issue.
I’ve found other solutions, but I really would like to know why it didn’t work since I use rosettacode a bunch. Is there a problem in the code that I just can’t identify or is it a quirk of the FCC code?
Here is the code, and when I run it through FCC it says reports “Potential infinite loop at line 14” (var p = nums[i])
Thanks in advance.