From 1d78e7e7fe446cc851aa00ba48caaf0f8d50e152 Mon Sep 17 00:00:00 2001 From: WellingtonWDS Date: Tue, 1 Nov 2022 09:18:36 -0300 Subject: [PATCH] feat(sum) Implementacao da funcao sum() --- 06-sum/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/06-sum/index.js b/06-sum/index.js index ebc2ee1..d0d3531 100644 --- a/06-sum/index.js +++ b/06-sum/index.js @@ -1,4 +1,10 @@ export function sum(values) { - // implementar logica aqui + let soma = 0; + + for(let i = 0; i < values.length; i++){ + soma = soma + values[i]; + } + + return soma; } \ No newline at end of file