Skip to content

Instantly share code, notes, and snippets.

@selfup
Created July 25, 2017 18:00
Show Gist options
  • Save selfup/803ae2d546db7183f8a2eba18c85664a to your computer and use it in GitHub Desktop.
Save selfup/803ae2d546db7183f8a2eba18c85664a to your computer and use it in GitHub Desktop.
return Object.assign(
{}, // << this is the important part - LOOK HERE!
cache,
{ [num]: (fib(num - 1, cache) + fib(num - 2, cache)) },
)[num];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment