From fce8544071905e07cbbc1e99d91733fd022dab88 Mon Sep 17 00:00:00 2001 From: Gustavo_Rallenson Date: Fri, 28 Oct 2022 20:19:33 -0300 Subject: [PATCH] Feat:Finalizado isPrime --- 05-isPrime/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..ad1c382 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,13 @@ export function isPrime(value) { // implementar logica aqui - + if(value === 1){ + return false + }else{ + for(let divisor = 2; divisor < value; divisor++){ + if((value%divisor === 0)){ + return false + } + } + } + return true } \ No newline at end of file