Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ChristianRich/9556aaac46e67b891b6200ee8f6b61dd to your computer and use it in GitHub Desktop.
Save ChristianRich/9556aaac46e67b891b6200ee8f6b61dd to your computer and use it in GitHub Desktop.
ES6 iterate object
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