12 lines
193 B
JavaScript
12 lines
193 B
JavaScript
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];
|
|
}
|