feat(isPrime): implementa funcao isPrime
This commit is contained in:
parent
a0a5c162e2
commit
1936ee284a
@ -1,4 +1,8 @@
|
||||
export function isPrime(value) {
|
||||
// implementar logica aqui
|
||||
|
||||
for(let i=2;i <= Math.sqrt(value);i++){
|
||||
if(value % i == 0 || value < 2)
|
||||
return false;
|
||||
}
|
||||
return true
|
||||
}
|
Loading…
Reference in New Issue
Block a user