Skip to content

Instantly share code, notes, and snippets.

@AlexJWayne
Created April 22, 2011 17:03
Show Gist options
  • Save AlexJWayne/62860f0c07d60320151c to your computer and use it in GitHub Desktop.
Save AlexJWayne/62860f0c07d60320151c to your computer and use it in GitHub Desktop.
for own attr, value of this
if attr == 'foo' && value == 'bar'
console.log 'Found a foobar!'
var attr, value;
var __hasProp = Object.prototype.hasOwnProperty;
for (attr in this) {
if (!__hasProp.call(this, attr)) continue;
value = this[attr];
if (attr === 'foo' && value === 'bar') {
console.log('Found a foobar!');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment