Last active
March 17, 2017 19:39
-
-
Save smallfx/d383691b2cdf55a45c3f1f2940892a34 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
// functionally "push" values from an Array onto an Object with UUID as key | |
import _ from 'lodash'; | |
import uuid from 'uuid'; | |
let oldguy = { "pretend-uuid": 9001 }; | |
let values = [1, 2, 3]; | |
Object.assign({}, oldguy, _.fromPairs( | |
_.map(values, (value) => [uuid(), value]) | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment