feat(sum): fazendo funcão

This commit is contained in:
Caroline Moran 2022-10-28 07:40:50 -04:00
parent 7801380351
commit 755ff029e8
2 changed files with 11 additions and 4 deletions

View File

@ -1,4 +1,7 @@
export function fibonacci(value) {
// implementar logica aqui
}
if (value <= `${1}`) {
return value;
}
return fibonacci(value - 1) + fibonacci(value - 2);
}

View File

@ -1,4 +1,8 @@
export function sum(values) {
// implementar logica aqui
}
function add(a, b) {
return a + b;
}
var soma = values.reduce(add, 0);
return soma;
}