diff --git a/04-fibonacci/index.js b/04-fibonacci/index.js index 37c64cc..c2e3898 100644 --- a/04-fibonacci/index.js +++ b/04-fibonacci/index.js @@ -1,4 +1,11 @@ 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 } \ No newline at end of file