challenge-algorithms-v2.0-m.../06-sum/index.js

9 lines
196 B
JavaScript
Raw Normal View History

export function sum(values) {
// implementar logica aqui
2022-10-31 17:55:36 +00:00
let total = 0;
for(let i = 0; i < values.length;i++)
2022-10-31 17:43:37 +00:00
{
2022-10-31 17:55:36 +00:00
total += values[i];
2022-10-31 17:43:37 +00:00
}
return total;
}