feature: resolve exercício 05-isPrime

This commit is contained in:
Andrea Matsunaga 2022-11-01 11:08:35 -03:00
parent 4a8c5c8874
commit a30dc629a3

View File

@ -1,4 +1,10 @@
export function isPrime(value) {
// implementar logica aqui
if (value <= 1) return false;
for (let divisor = 2; divisor <= Math.sqrt(value); divisor++) {
if (value % divisor === 0) {
return false
}
}
return true
}