2022-10-27 15:07:13 +00:00
|
|
|
export function fibonacci(value) {
|
|
|
|
// implementar logica aqui
|
2022-10-28 14:49:25 +00:00
|
|
|
let n1 = 0
|
|
|
|
let n2 = 1
|
|
|
|
let fibo
|
|
|
|
|
|
|
|
for (let i = 1; i <= value; i++) {
|
|
|
|
fibo = n1 + n2;
|
|
|
|
n1 = n2;
|
|
|
|
n2 = fibo;
|
|
|
|
};
|
|
|
|
|
|
|
|
return n1
|
2022-10-27 15:07:13 +00:00
|
|
|
|
|
|
|
}
|