Reviewing recursion with The Odin Project.
Recursion exercises taken from The Odin Project
-
Using iteration, write a function fibs which takes a number and returns an array containing that many numbers from the Fibonacci sequence. Using an example input of 8, this function should return the array [0, 1, 1, 2, 3, 5, 8, 13].
-
Now write another function fibsRec which solves the same problem recursively
node [file name]
Example:
node merge-sort.js