Skip to content

Instantly share code, notes, and snippets.

@Octagon-simon
Created June 15, 2022 12:56
Show Gist options
  • Select an option

  • Save Octagon-simon/a7ee3aec476aca4f36148601e1fa5f69 to your computer and use it in GitHub Desktop.

Select an option

Save Octagon-simon/a7ee3aec476aca4f36148601e1fa5f69 to your computer and use it in GitHub Desktop.
const profile = {
name : "Simon",
email: "me@you.com",
gender : "male"
}
//loop through keys
Object.keys(profile).forEach( (key) => {
//access object value using key
console.log( key+' = '+profile[key] );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment