Skip to content

Instantly share code, notes, and snippets.

@lorenzo-gasperoni
Last active March 29, 2016 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorenzo-gasperoni/693e9c9de01deed9aa19 to your computer and use it in GitHub Desktop.
Save lorenzo-gasperoni/693e9c9de01deed9aa19 to your computer and use it in GitHub Desktop.
// object
var object = {
label1: 'value1',
label2: 'value2'
};
// cycle object having access to labels and values
Object.keys(person).forEach(function(trait) {
console.log('Person ', trait,': ', person[trait]);
});
// (source: https://davidwalsh.name/object-keys)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment