feat(fibonacci): made fourth challenge

This commit is contained in:
Gabriel Ferreira Lehmann 2022-10-29 23:13:17 -03:00
parent c6f6df9c59
commit 2c536af001

View File

@ -1,4 +1,12 @@
export function fibonacci(value) {
// implementar logica aqui
let n1 = 0
let n2 = 1
let temp
for (let i = 0; i < value; i++) {
temp = n1
n1 = n1 + n2
n2 = temp
}
return n1
}