Created
March 7, 2011 22:58
-
-
Save fat/859445 to your computer and use it in GitHub Desktop.
make this better.
This file contains hidden or 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 __tailingFn () { | |
for (var i = arguments.length; i--;) { | |
if (typeof arguments[i] == 'function') { | |
var fn = arguments[i]; | |
arguments[i] = undefined; | |
return fn; | |
} | |
} | |
} |
ded
commented
Mar 7, 2011
What is the point of unsetting the fn if this is all there is to __tailingFn? arguments ceases to exist after the function is exited anyways...
function __tailingFn () {
var a, i = arguments.length;
while (a = arguments[i--])
if (typeof a == 'function') {
return a;
}
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment