feat(06): finished

This commit is contained in:
Matheus Brollo Dauter 2022-10-31 14:15:35 -03:00
parent 82a96126a4
commit d1c7f499b0

View File

@ -1,8 +1,15 @@
export function sum(values) {
// implementar logica aqui
let soma = 0
for (let index = 0; index < values.lenght; index += 1) {
soma = soma + values[index];
}
return soma;
if (toString.call(values) !== "[object Array]")
return false;
var total = 0;
for(var i=0;i<values.length;i++)
{
if(isNaN(values[i])){
continue;
}
total += Number(values[i]);
}
return total;
}