From d5517be6923162d02b797e9ce69da710d437e4dc Mon Sep 17 00:00:00 2001 From: Gabriel Ferraz Date: Fri, 4 Nov 2022 15:00:06 -0300 Subject: [PATCH] =?UTF-8?q?perfom(Aula1):=20simplifica=C3=A7=C3=A3o=20do?= =?UTF-8?q?=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Aula1.html | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Aula1.html b/Aula1.html index 836ec68..c09e2a6 100644 --- a/Aula1.html +++ b/Aula1.html @@ -66,20 +66,14 @@ // return par / 5 function paresPor5() { const numbers = []; + const pares5 = [] for (let i = 0; i < 40; i++) { let numb = Math.floor(Math.random() * 100) + if (numb % 2 === 0 && numb % 5 === 0) {pares5.push(numb)} numbers.push(numb); }; - console.log(numbers); - const pares5 = [] - numbers.forEach(element => { - if (element % 2 === 0 ) { - if (element % 5 === 0) { - pares5.push(element) - } - } - }); - console.log(pares5); + //console.log(numbers); + return pares5; } paresPor5();