forked from M3-Academy/challenge-algorithms-v2.0
feature/algoritmos #1
@ -1,4 +1,13 @@
|
||||
export function fibonacci(value) {
|
||||
// implementar logica aqui
|
||||
let previous = 0;
|
||||
let sum = 0;
|
||||
let next = 1;
|
||||
|
||||
for (let i = 0; i < value; i++) {
|
||||
sum = previous + next;
|
||||
previous = next;
|
||||
next = sum;
|
||||
}
|
||||
return previous;
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user