feat(desafio): Adiciona sexta tarefa concluida

This commit is contained in:
Manuela Luana Schumacker Tavares 2022-10-28 16:09:30 -03:00
parent 7e5a62c8b2
commit 955c3872fa

View File

@ -1,4 +1,17 @@
export function sum(values) { export function sum(values) {
// implementar logica aqui // implementar logica aqui
let soma = 0;
if(values.length == 1){
for(let i = 0; i < values.length; i++){
soma = values[i];
}
return soma;
}else if(values.length == []){
return soma = 0;
}else{
for(let i = 0; i < values.length; i++){
soma += values[i];
}
return soma;
}
} }