function fibonacciMemo(n, memo = {}) {
  // Base Cases
  if (n === 0) return 0;
  if (n === 1) return 1;

  // Test if value already calculated
  if (memo[n]) {
    return memo[n];
  }

  // Recursive Case with Memoization
  memo[n] = fibonacciMemo(n - 1, memo) + fibonacciMemo(n - 2, memo);
  return memo[n];
}

// Test Cases
console.log(fibonacciMemo(50)); // => 12586269025
