feat(fibonacci): adicionando a logica da funcao

This commit is contained in:
Guilherme Carvalho da Rosa 2022-10-28 16:33:01 -03:00
parent a2939d24e2
commit 40c3f7c838

View File

@ -1,4 +1,8 @@
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]
}