Last active
July 12, 2017 13:12
-
-
Save suissa/7c07221e9f788d695ea7fd97c100000b to your computer and use it in GitHub Desktop.
Verificando número primo
This file contains 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
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