forked from M3-Academy/challenge-algorithms-v2.0
feat: resolve funcão sum
This commit is contained in:
parent
5325173f4c
commit
cc1c140869
@ -1,4 +1,12 @@
|
||||
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;
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user