forked from M3-Academy/challenge-algorithms-v2.0
11 lines
193 B
JavaScript
11 lines
193 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;
|
|
} |