fib = n => {
    if (cache[n] === undefined) {
      cache[n] = fib(n - 1) + fib(n - 2);
    }
    return cache[n];
  }
Implementation with memoization, O(n) in time, O(n) in space

@param Number
@return Number