Created
March 17, 2018 00:34
-
-
Save audunolsen/5121cefbcf0a5429ea5a68e3cdfc01a6 to your computer and use it in GitHub Desktop.
Handy oneliner for converting an array to an object.
This file contains 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
ObjFromArr = (arr) => Object.assign {}, ...arr.map (item) => item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment