forked from M3-Academy/challenge-algorithms-v2.0
feat: resolve funcão isPrime
This commit is contained in:
parent
33405f4457
commit
5325173f4c
@ -1,4 +1,14 @@
|
||||
export function isPrime(value) {
|
||||
// implementar logica aqui
|
||||
let div = 0;
|
||||
let i;
|
||||
for (i = 1; i <= value; i++) {
|
||||
if ((value % i) == 0)
|
||||
div++;
|
||||
}
|
||||
if (div === 2)
|
||||
return true;
|
||||
else
|
||||
return false
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user