forked from M3-Academy/challenge-algorithms-v2.0
feat(05-isPrime0: Adiciona função
This commit is contained in:
parent
6abc22ea8e
commit
209e6ee2aa
@ -1,4 +1,5 @@
|
||||
export function isPrime(value) {
|
||||
// implementar logica aqui
|
||||
|
||||
var start = 2;
|
||||
while (start <= Math.sqrt(value)) if (value % start++ < 1) return false;
|
||||
return value > 1;
|
||||
}
|
Loading…
Reference in New Issue
Block a user