Skip to content

Instantly share code, notes, and snippets.

@chmelevskij
Created July 28, 2020 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chmelevskij/6f0ed2f7a28c7dba9d29c721cf098ab8 to your computer and use it in GitHub Desktop.
Save chmelevskij/6f0ed2f7a28c7dba9d29c721cf098ab8 to your computer and use it in GitHub Desktop.
// from https://stackoverflow.com/a/47916931/3618387
const destruct = (obj, ...keys) =>
keys.reduce((a, c) => { a[c] = obj[c]; return a; }, {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment