feat: Resolve o exercício 04-fibonacci

This commit is contained in:
SamuelCondack 2022-10-27 16:46:52 -03:00
parent 8a86650b28
commit a92b3f3aeb

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;
}