From e7aa3ebfa494d50f99da6f403b8fd8241ea34fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cain=C3=A3=20Milech?= Date: Fri, 28 Oct 2022 18:09:53 -0300 Subject: [PATCH] feat(isPrime): implementa function --- 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..f77634f 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,12 @@ export function isPrime(value) { - // implementar logica aqui - + + if(value === 1){ + return false; + + } for(let divisor = 2; divisor < value; divisor++){ + if(value % divisor === 0){ + return false; + } + } return true; + } \ No newline at end of file