2022-10-27 15:07:13 +00:00
|
|
|
export function fibonacci(value) {
|
|
|
|
// implementar logica aqui
|
2022-10-30 02:13:17 +00:00
|
|
|
let n1 = 0
|
|
|
|
let n2 = 1
|
|
|
|
let temp
|
|
|
|
for (let i = 0; i < value; i++) {
|
|
|
|
temp = n1
|
|
|
|
n1 = n1 + n2
|
|
|
|
n2 = temp
|
|
|
|
}
|
|
|
|
return n1
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|