feat(desafio): Adiciona sexta tarefa concluida #5

Merged
ManuelaLuanaSchumackerTavares merged 1 commits from feature/sum into feature/algoritmo 2022-10-28 19:10:51 +00:00

View File

@ -1,4 +1,17 @@
export function sum(values) {
// 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;
}
}