Skip to content

Instantly share code, notes, and snippets.

@Guseyn
Created March 22, 2022 13:54
Show Gist options
  • Save Guseyn/2f8cb0c3c8bcc040381d4047ee75cf86 to your computer and use it in GitHub Desktop.
Save Guseyn/2f8cb0c3c8bcc040381d4047ee75cf86 to your computer and use it in GitHub Desktop.
Fill map from array
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