feat: Resolve o exercício 05-isPrime

This commit is contained in:
SamuelCondack 2022-10-27 16:52:08 -03:00
parent a92b3f3aeb
commit 0771958d28

View File

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