From 1b584da7b21cab2956faefcce4350da001425e4f Mon Sep 17 00:00:00 2001 From: HenriqueSSan Date: Thu, 27 Oct 2022 20:58:33 -0300 Subject: [PATCH] feat(challenge-5): completed challenge --- 05-isPrime/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..397ac79 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,12 @@ export function isPrime(value) { // implementar logica aqui - -} \ No newline at end of file + if (!value) return 0; + + for(let i = 2; i < value; i++){ + if(value % i === 0){ + return false + } + } + + return true +}