20 lines
387 B
JavaScript
20 lines
387 B
JavaScript
export function isPrime(value) {
|
|
// implementar logica aqui
|
|
let prime = true
|
|
|
|
if(value > 1){
|
|
for(let i=2; i < value; i++){
|
|
if(value % i === 0){
|
|
prime = false
|
|
break;
|
|
}
|
|
}
|
|
if(prime === true){
|
|
return true
|
|
}else{
|
|
return false
|
|
}
|
|
}else{
|
|
return false
|
|
}
|
|
} |