I am trying to teach myself node.js (no javascript or real programming experience) and have hit a road block on one of the problems I am trying to solve. My goal is to write the
This works even beter if you preinitialize the list and skip testing the primality of multiples of 2
var primes = [2]; --nPrimes for( var n = 3; nPrimes > 0; n += 2 )
I just finished very similar code for the Startup Engineering course homework @Coursera ;)