Skip to content

Instantly share code, notes, and snippets.

@draeton
Created August 20, 2011 00:13
Show Gist options
  • Save draeton/1158368 to your computer and use it in GitHub Desktop.
Save draeton/1158368 to your computer and use it in GitHub Desktop.
Function.prototype.tail
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