From 33f0b9cf1c1852f9cf8586cfa8b91c1317e0a0d9 Mon Sep 17 00:00:00 2001 From: Rhayllon Date: Sat, 29 Oct 2022 04:13:54 -0300 Subject: [PATCH] Feat(Desafio_2.5): Cria resposta desafio 2.5 --- 05-isPrime/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..9959aee 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,9 @@ export function isPrime(value) { // implementar logica aqui - + for (let n = 2; n < value; n++) + if (value % n === 0){ + return false + } + return value > 1 + } \ No newline at end of file -- 2.34.1