Created
October 19, 2010 20:06
-
-
Save madrobby/634992 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Solution to Part 2. | |
function isPrime(num) { | |
var prime = num != 1; | |
for ( var i = 2; i < num; i++ ) { | |
if ( num % i == 0 ) { | |
prime = false; | |
break; | |
} | |
} | |
return prime; | |
} | |
isPrime = isPrime.cached(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment