Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Generate first N prime numbers

Recently I am taking an online course named "Startup Engineering" on coursera. There is one assignment which is to use NodeJS to write a program to generate the first 100 prime numbers. This may be very easy for many people. Here I just want to share with you the code to generate not only the first 100 prime numbers. but also any number of prime numbers.Below is the code snippet://Helper class to generate prime numbersvar PrimeProcessor=(function(){ var primeArray=[]; function _isPrime(num){ if(num<=1){ throw new Error("Number cannot be sm...

11,756 5       JAVASCRIPT ALGORITHM NODEJS PRIME NUMBER COURSERA