Skip to content

Instantly share code, notes, and snippets.

@Ivannnnn
Created September 1, 2022 22:21
Show Gist options
  • Save Ivannnnn/8f8ecd59c074013028b5447da7c7854a to your computer and use it in GitHub Desktop.
Save Ivannnnn/8f8ecd59c074013028b5447da7c7854a to your computer and use it in GitHub Desktop.
const select = (obj, propArr) =>
propArr.reduce((acc, val) => {
acc[val] = obj[val];
return acc;
}, {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment