fix(fibonacci): retirando comentario de codigo antigo

fibonacci
This commit is contained in:
Bernardo Cunha Ernani Waldhelm 2022-10-29 09:48:55 -03:00
parent d443e5364a
commit 712a0b5a6e

View File

@ -4,16 +4,10 @@ export function fibonacci(value) {
return value;
}
// const resultado = fibonacci(value - 1) + fibonacci(value - 2);
// return resultado;
let arr = [0, 1];
for (let i = 2; i < value + 1; i++) {
arr[i] = arr[i - 2] + arr[i - 1];
}
return arr[value];
}
let f = fibonacci(46);
console.log(f);
}