feat(isPrime): Implementa função isPrime

This commit is contained in:
danielmoliaribarbosa 2022-10-28 15:03:13 -03:00
parent cfe0e803bf
commit 264b1a1660

View File

@ -1,4 +1,9 @@
export function isPrime(value) { export function isPrime(value) {
// implementar logica aqui // implementar logica aqui
for (let x = 2; x < value; x++) {
if (value % x === 0 || value <= 1) {
return false;
}
}
return true;
} }