forked from M3-Academy/challenge-algorithms-v2.0
somando um array
This commit is contained in:
parent
0f4862a8d5
commit
fefb2522c8
@ -1,4 +1,8 @@
|
||||
export function sum(values) {
|
||||
// implementar logica aqui
|
||||
|
||||
var arr = values;
|
||||
var soma = 0;
|
||||
for(var i = 0; i < arr.length; i++) {
|
||||
soma += arr[i];
|
||||
}
|
||||
return soma;
|
||||
}
|
Loading…
Reference in New Issue
Block a user