forked from M3-Academy/challenge-algorithms-v2.0
11 lines
219 B
JavaScript
11 lines
219 B
JavaScript
export function fibonacci(value) {
|
|
// implementar logica aqui
|
|
|
|
let term = 0, actual = 1, next;
|
|
for (let i = 1; i <= value; i++) {
|
|
next = term + actual;
|
|
term = actual;
|
|
actual = next;
|
|
}
|
|
return term
|
|
} |