challenge-algorithms-v2.0/04-fibonacci/index.js

12 lines
193 B
JavaScript
Raw Normal View History

export function fibonacci(value) {
// implementar logica aqui
let f = [];
f[0] = 0;
f[1] = 1;
for (n = 2; n <= value; n++) {
f[n] = f[n - 1] + f[n - 2];
}
return f[value];
}