+1 vote
by
let fib = (num) => {
return num <= 1
? num
: fib(num - 1) + fib(num - 2);
}
console.log(fib(10));
How do I make all the numbers in the Fibonacci sequence go in order, not just the end result?

1 Answer

+1 vote
by
Compute them in order in a loop, not by recursion. Your C.O.
...