From 09f4747e46eed4bc1b247e480458ec72bf5dc9ad Mon Sep 17 00:00:00 2001 From: wellington carlos Date: Fri, 28 Oct 2022 20:21:57 -0300 Subject: [PATCH] (feat)finalizando o teste 05 isPrime --- 05-isPrime/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..2f59911 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,10 @@ export function isPrime(value) { - // 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