Algorithms - Calculating Prime Numbers

In this blog, I will write a small sample showing how to calculate prime numbers in javascript using a technique called memoization. 
Memoization is the technique where we add a property to a function so that it can remember its previously computed values. Let's take a look at the code.