Created
May 17, 2017 10:21
-
-
Save bjdixon/251c5ca1832473a68507ee8102b6a235 to your computer and use it in GitHub Desktop.
Initialise a nested object from an array of keys
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
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