From d51aa1b44ba5ecc57b150b5fc237dcf1cc8fcf56 Mon Sep 17 00:00:00 2001 From: LeonardoPereiraRocha Date: Fri, 28 Oct 2022 21:19:21 -0300 Subject: [PATCH] =?UTF-8?q?feat(06-sum):=20Cria=20a=20fun=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 06-sum/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/06-sum/index.js b/06-sum/index.js index ebc2ee1..1c56f1b 100644 --- a/06-sum/index.js +++ b/06-sum/index.js @@ -1,4 +1,6 @@ export function sum(values) { - // implementar logica aqui - + let sumAll = 0; + for (let i = 0; i < values.length; i++) { + sumAll = sumAll + values[i]; + } return sumAll; } \ No newline at end of file