Created
March 5, 2019 06:16
-
-
Save RuNpiXelruN/94c3642341156ac343c11d9787224f11 to your computer and use it in GitHub Desktop.
Merge two arrays into 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
const keys = [ "height", "width" ] | |
const values = [ "12px", "24px" ] | |
const merged = values.reduce((obj, value, index) => ({...obj, [keys[index]]: value}), {}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment