Created
August 20, 2011 00:13
-
-
Save draeton/1158368 to your computer and use it in GitHub Desktop.
Function.prototype.tail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function.prototype.tail = function (cb) { | |
var fn = this; | |
return function () { | |
var ret = fn.apply(this, arguments); | |
return cb ? cb.apply(this, [].concat(ret)): ret; | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment