Last active
January 2, 2023 21:34
-
-
Save briyithhhh/102d55a41c6c12b60823ada58e99455a to your computer and use it in GitHub Desktop.
Two arrays to an array of object
This file contains hidden or 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 result = (keys, values) => { | |
| return (Object.fromEntries(keys.map((key, i) => | |
| [key, values[i]] | |
| )))} | |
| result( | |
| ["name", "lastname", "born"], | |
| ["Briyith", "Portillo", 2002] | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment