feat(fibonacci): desenvolvimento da funcao

This commit is contained in:
Filipe Quintanilha Evangelista 2022-10-28 12:49:18 -03:00
parent 2fcbcd717c
commit 33485e66ff

View File

@ -1,4 +1,11 @@
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;
}