feat: implementa função fibonacci

This commit is contained in:
RodrigoJorge 2022-10-28 15:11:33 -03:00
parent 70f64ffee3
commit 63fd0f2dda

View File

@ -1,4 +1,11 @@
export function fibonacci(value) {
// implementar logica aqui
let num1 = 0;
let num2 = 1;
for(let i = 0; i < value; i++){
let aux = num1;
num1 = num2;
num2 += aux;
}
return num1;
}