From cc1c140869772b9e65a52baf73be7435e842c7a9 Mon Sep 17 00:00:00 2001 From: JoseGregorioMataRodriguez Date: Sat, 29 Oct 2022 01:34:41 -0200 Subject: [PATCH] =?UTF-8?q?feat:=20resolve=20func=C3=A3o=20sum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 06-sum/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/06-sum/index.js b/06-sum/index.js index ebc2ee1..9211b82 100644 --- a/06-sum/index.js +++ b/06-sum/index.js @@ -1,4 +1,12 @@ export function sum(values) { // implementar logica aqui + let suma = 0; + let i = 0; + if (values) { + for (i = 0; i < values.length; i++){ + suma+= values[i]; + } + } + return suma; } \ No newline at end of file