Skip to content

Instantly share code, notes, and snippets.

@GengGao
Created December 20, 2013 22:37
Show Gist options
  • Save GengGao/8062726 to your computer and use it in GitHub Desktop.
Save GengGao/8062726 to your computer and use it in GitHub Desktop.
for-in Loops that filters prototypes
var i, hasOwn = Object.prototype.hasOwnProperty;
for (i in man) {
if (hasOwn.call(man, i)) { // filter
console.log(i, ":", man[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment