secret
Created

  • Download Gist
attr.coffee
CoffeeScript
1 2 3
for own attr, value of this
if attr == 'foo' && value == 'bar'
console.log 'Found a foobar!'
attr.js
JavaScript
1 2 3 4 5 6 7 8 9
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!');
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.