feat(05-isPrime0: Adiciona função

This commit is contained in:
Emerson Fully 2022-10-29 14:16:32 -03:00
parent 6abc22ea8e
commit 209e6ee2aa

View File

@ -1,4 +1,5 @@
export function isPrime(value) {
// implementar logica aqui
var start = 2;
while (start <= Math.sqrt(value)) if (value % start++ < 1) return false;
return value > 1;
}