forked from M3-Academy/challenge-algorithms-v2.0
Merge pull request 'feat(isPrime): algoritmo criado.' (#5) from feature/algorithm05 into development
Reviewed-on: #5
This commit is contained in:
commit
8a6eb24cbd
@ -1,4 +1,9 @@
|
||||
export function isPrime(value) {
|
||||
// implementar logica aqui
|
||||
for(let i = 2; i < value; i++) {
|
||||
if(value % i === 0) return false;
|
||||
else if(value === 2) return true;
|
||||
}
|
||||
|
||||
return value > 1;
|
||||
}
|
Loading…
Reference in New Issue
Block a user