forked from M3-Academy/challenge-algorithms-v2.0
10 lines
197 B
JavaScript
10 lines
197 B
JavaScript
export function fibonacci(value) {
|
|
// implementar logica aqui
|
|
const fib = [0,1]
|
|
let i = 1
|
|
while (value > fib.length-1){
|
|
fib.push(fib[i - 1] + fib[i])
|
|
i ++
|
|
}
|
|
return fib[value]
|
|
} |