From 8d311cb1e5a383e79859d38ba7c3bc76e23d438c Mon Sep 17 00:00:00 2001 From: Rafael Sampaio Date: Fri, 28 Oct 2022 10:04:23 -0300 Subject: [PATCH] feat: solucao isPrime --- 05-isPrime/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..740d231 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,8 @@ export function isPrime(value) { // implementar logica aqui - -} \ No newline at end of file + for (let i = 2; i < value; i++) + if (value % i === 0) { + return false; + } + return value > 1; +}