forked from M3-Academy/challenge-algorithms-v2.0
feat(06): finished
This commit is contained in:
parent
82a96126a4
commit
d1c7f499b0
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user