Skip to content

Instantly share code, notes, and snippets.

@bjdixon bjdixon/buildObj.js
Created May 17, 2017

Embed
What would you like to do?
Initialise a nested object from an array of keys
const build = path => path.reduceRight((o, i) => Object.assign({}, {[i]: o}), {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.