Edit: Turns out there are no bugs here, I made a typo thanks gebulmer for figuring it out!
Hey guys, I was doing the Intermediate Algorithm Scripting: Sum All Primes challenge and having some problems with it. I wanted to do it anyways and coded it locally on my machine. I got it to work in the fcc page but the results are different than what I got. Its the same exact code. I pasted it into codepen.io as well and it gave me the same result as my local computer.
These are the output from the fcc page (the code passed all the tests):
New for: 10 12:55:47.637 VM358:42 upper limit: 3 (rounded down square root of num) 12:55:47.641 VM358:43 result: 17 12:55:47.654 VM358:41 New for: 977 12:55:47.664 VM358:42 upper limit: 31 (rounded down square root of num) 12:55:47.675 VM358:43 result: 73156
These are the results from my local machine/codepen.io
New for: 10 test-3.html:22 upper limit: 3 (rounded down square root of num) test-3.html:23 result: 17 test-3.html:21 New for: 997 test-3.html:22 upper limit: 31 (rounded down square root of num) test-3.html:23 result: 76127
Ill attach screen shots below.
This is adding all the prime numbers up on google, pulled from a list of prime numbers on another website.