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