Skip to content

Instantly share code, notes, and snippets.

@suissa
Last active July 12, 2017 13:12
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 suissa/7c07221e9f788d695ea7fd97c100000b to your computer and use it in GitHub Desktop.
Save suissa/7c07221e9f788d695ea7fd97c100000b to your computer and use it in GitHub Desktop.
Verificando número primo
var primo = function(n){
if (!isNaN(n)) {
if (n != 1) {
for (i = 2; i < n; i++) {
if(n % i == 0){
return false;
}
}
return n !== 1;
}
return false;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment