feat(isPrime): Responde função 05

This commit is contained in:
Affonso Kopmann 2022-10-30 15:33:26 -03:00
parent c4e8de1c15
commit 0de9bd577c

View File

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