forked from M3-Academy/challenge-algorithms-v2.0
8 lines
187 B
JavaScript
8 lines
187 B
JavaScript
export function fibonacci(value) {
|
|
// implementar logica aqui
|
|
const fibo = [0, 1]
|
|
for (let i = 2; i <= value; i++) {
|
|
fibo[i] = fibo[i-1] + fibo[i-2]
|
|
}
|
|
return fibo[value]
|
|
} |