Created
July 8, 2022 06:17
-
-
Save ChristianRich/9556aaac46e67b891b6200ee8f6b61dd to your computer and use it in GitHub Desktop.
ES6 iterate 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 myObj = { firstName: 'John', lastName: 'Doe' }; | |
for (const [key, value] of Object.entries(myObj)) { | |
console.log(`${key} ${value}`); // John Doe | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment