Last active
October 26, 2016 21:56
-
-
Save dlabey/35c9e57b6e6ce75228195da1a2fc7feb to your computer and use it in GitHub Desktop.
Determines Whether a Number Is Prime
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
function isPrime(value) { | |
for(var i = 2; i < value; i++) { | |
if(value % i === 0) { | |
return false; | |
} | |
} | |
return value > 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment