challenge-algorithms-v2.0-A.../05-isPrime/index.js

13 lines
273 B
JavaScript
Raw Permalink Normal View History

export function isPrime(value) {
// implementar logica aqui
2022-10-29 03:23:38 +00:00
var divisores = 0
for (let i = 0; i <=value; i++) {
if(value%i==0){
divisores++;
}
}
if (divisores==2){
return true;
}else
return false;
}