Skip to content

Instantly share code, notes, and snippets.

@audunolsen
Created March 17, 2018 00:34
Show Gist options
  • Save audunolsen/5121cefbcf0a5429ea5a68e3cdfc01a6 to your computer and use it in GitHub Desktop.
Save audunolsen/5121cefbcf0a5429ea5a68e3cdfc01a6 to your computer and use it in GitHub Desktop.
Handy oneliner for converting an array to an object.
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