forked from M3-Academy/challenge-algorithms-v2.0
Merge pull request 'feat(desafio05):desafio-completo' (#5) from feature/desafio05 into develop
Reviewed-on: #5
This commit is contained in:
commit
2ed084cc0b
@ -1,4 +1,13 @@
|
||||
export function isPrime(value) {
|
||||
// implementar logica aqui
|
||||
|
||||
if(value == 0 || value == 1) {
|
||||
return false
|
||||
}
|
||||
|
||||
for(let div = 2; div <= Math.sqrt(value); div++){
|
||||
if(value % div == 0) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
Loading…
Reference in New Issue
Block a user