feat: Adiciona o código do desafio 5

This commit is contained in:
Gabriel Gomes Fernandes 2022-10-31 13:55:02 -03:00
parent a847d93559
commit a3ba7348e9

View File

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