forked from M3-Academy/challenge-algorithms-v2.0
14 lines
268 B
JavaScript
14 lines
268 B
JavaScript
export function isPrime(value) {
|
|
// implementar logica aqui
|
|
let Prime = true;
|
|
for (let i = 2; i < value; i++) {
|
|
if (value % i === 0) {
|
|
Prime = false;
|
|
break;
|
|
}
|
|
}
|
|
if (Prime === true && value === 1) {
|
|
Prime = false;
|
|
}
|
|
return Prime;
|
|
} |