Merge branch 'feature/fibonacci'

This commit is contained in:
Marcela Mathias 2022-11-02 16:56:11 -03:00
commit 25d87348b5

View File

@ -1,4 +1,11 @@
export function fibonacci(value) { export function fibonacci(value) {
// implementar logica aqui if (value == 0) return 0;
let firstValue = 0;
} let secondValue = 1;
for (let i = 2; i <= value; i++) {
let newValue = firstValue;
firstValue = secondValue;
secondValue += newValue;
}
return secondValue;
}