Created
March 22, 2022 13:54
-
-
Save Guseyn/2f8cb0c3c8bcc040381d4047ee75cf86 to your computer and use it in GitHub Desktop.
Fill map from array
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 = [ 'a', 'b', 'c' ] | |
const values = [ 1, 2, 3 ] | |
const map = {} | |
keys.forEach((k, i) => { map[k] = values[i] }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment