feat: resolve fibonacci

This commit is contained in:
Naian Felix dos Santos 2022-10-28 08:42:28 -03:00
parent 31a926baf2
commit 10b8f2fd45

View File

@ -1,4 +1,15 @@
export function fibonacci(value) {
// implementar logica aqui
let val1 = 0
let val2 = 1
let valFib
for (let i = 1; i <= value; i++){
valFib = val2 + val1
val1 = val2
val2 = valFib
}
return val1
}