feat(sum): exercicio resolvido

This commit is contained in:
peocz95@gmail.com 2022-11-01 22:25:37 -03:00
parent ad6a2b9082
commit 45b2f09ae6
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,4 @@
export function maxValue(values) {
// implementar logica aqui
return Math.max(null,values);
return Math.max.apply(null, values)
}

View File

@ -1,4 +1,10 @@
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;
}