Created
September 24, 2020 12:18
-
-
Save ekrem-aktas/2564186b086c2ba1127940232356e5c0 to your computer and use it in GitHub Desktop.
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 members = [["name", "apple"], ["type", "fruit"]]; | |
const obj = Object.create(null); | |
members.forEach(([key, value]) => obj[key] = value); | |
console.log(obj); // { name: "apple", type: "fruit" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment