From 43527c0fe69f50b0a3b7f051806d3e6cd0396a59 Mon Sep 17 00:00:00 2001 From: Gabriel Lehmann Date: Sat, 29 Oct 2022 23:19:28 -0300 Subject: [PATCH] feat(isprime): made fifth challenge --- 05-isPrime/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..0c09d66 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,9 @@ export function isPrime(value) { - // implementar logica aqui - +// implementar logica aqui + for (let i = 2; i < value; i++) { + if (value % i === 0) { + return false; + } + } + return value > 1; } \ No newline at end of file