Skip to content

Instantly share code, notes, and snippets.

@sandboxws
Created September 28, 2011 19:32
Show Gist options
  • Select an option

  • Save sandboxws/1248982 to your computer and use it in GitHub Desktop.

Select an option

Save sandboxws/1248982 to your computer and use it in GitHub Desktop.
JavaScript for loop an object
var person = {
name: 'Ahmed El.Hussaini',
age: 31,
email: 'ahmed.elhussaini@espace.com.eg',
blog: 'http://sandboxws.com',
splinterScore: 224,
splinterProfileUrl: 'http://splinterme.com/sandboxws'
};
for(property in person) {
console.log(property + ': ' + person[property]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment