Skip to content

Instantly share code, notes, and snippets.

@shaneharter

shaneharter/tap.js

Forked from evilbuck/tap.js
Created Dec 18, 2012
Embed
What would you like to do?
Object.defineProperty(Object.prototype, 'tap', {
value: function(fun){
fun.call( this );
return this;
},
enumerable: false
});
// Usage:
// a = [];
// a.tap(function(){ this.push('foo'); });
// a => [ 'foo' ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.