Skip to content

Instantly share code, notes, and snippets.

@hebertcisco
Created May 23, 2020 05:28
Show Gist options
  • Save hebertcisco/909d9929857d25108ab5f4217d174767 to your computer and use it in GitHub Desktop.
Save hebertcisco/909d9929857d25108ab5f4217d174767 to your computer and use it in GitHub Desktop.
The for in loop interacts over an object's enumerated properties, in the original order of insertion. The loop can be performed for each distinct object property.
const team = [
{
name: "John Doe",
occupation: "Web Design",
},
{
name: "Jane Doe",
occupation: "photographer",
},
];
for (let employee in team) {
console.log(team[employee]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment