forked from M3-Academy/challenge-algorithms-v2.0
Merge branch 'feature/05-isPrime' into development
This commit is contained in:
commit
b38e95acb3
@ -1,4 +1,10 @@
|
|||||||
export function isPrime(value) {
|
export function isPrime(value) {
|
||||||
// implementar logica aqui
|
if (value <= 1) return false;
|
||||||
|
|
||||||
|
for (let divisor = 2; divisor <= Math.sqrt(value); divisor++) {
|
||||||
|
if (value % divisor === 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user