From 2a50005c3141db73a8c9397182626a41447d3173 Mon Sep 17 00:00:00 2001 From: Nathalia Sardou Date: Sun, 30 Oct 2022 00:36:25 -0300 Subject: [PATCH] sum atualizado --- 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..d5ad1e6 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 total = 0; + for (let i = 0; i < values.length; i++) { + total += values[i]; + } + return total; +}