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

8 lines
174 B
JavaScript

export function fibonacci(value) {
// implementar logica aqui
const arr = [0, 1]
for(let i = 1; i<value; i++){
arr.push(arr[i]+arr[i-1])
}
return arr[value]
}