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

12 lines
200 B
JavaScript

export function sum(values) {
// implementar logica aqui
let suma = 0;
let i = 0;
if (values) {
for (i = 0; i < values.length; i++){
suma+= values[i];
}
}
return suma;
}