Skip to content

Instantly share code, notes, and snippets.

@dlabey
Last active October 26, 2016 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlabey/35c9e57b6e6ce75228195da1a2fc7feb to your computer and use it in GitHub Desktop.
Save dlabey/35c9e57b6e6ce75228195da1a2fc7feb to your computer and use it in GitHub Desktop.
Determines Whether a Number Is Prime
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