11 lines
185 B
JavaScript
11 lines
185 B
JavaScript
export function fibonacci(value) {
|
|
// implementar logica aqui
|
|
let a = 0, b = 1, c = value
|
|
|
|
for (let i = 2; i <= value; i++){
|
|
c = a + b;
|
|
a = b;
|
|
b = c;
|
|
}
|
|
return c;
|
|
} |