Last active
August 4, 2022 06:30
-
-
Save sethdavis512/1c2f0cf5de1c6ed20d02d571b39720e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const keyBy = (arr, objKey) => arr.reduce( | |
(acc, cur) => ( | |
{ ...acc, [cur[objKey]]: cur } | |
), {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment