From 9eb9524cf96eb6a005763534715489202fa814f5 Mon Sep 17 00:00:00 2001 From: ThiagoDuutra Date: Fri, 28 Oct 2022 16:59:10 -0300 Subject: [PATCH] feat: Resolvido questao sum --- 06-sum/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/06-sum/index.js b/06-sum/index.js index ebc2ee1..93deb22 100644 --- a/06-sum/index.js +++ b/06-sum/index.js @@ -1,4 +1,8 @@ export function sum(values) { // implementar logica aqui - -} \ No newline at end of file + let result = 0; + for (let i = 0; i < values.length; i++) { + result += values[i]; + } + return result; +}