>>54 Good point.
>>53
The factorial is meant to be the same. It wouldn't be much use if a different function was tested, would it? I defined them separately because I didn't want to JS implementation to make assumptions about the function and them have those assumptions possibly broken when it's called in a different manner.
Anyway, as you spotted, I was using an incorrect version of the file. With the proper version below they perform the same (except on TraceMonkey, which you obviously aren't using anyway if you managed to get 567ms earlier). So your claim that using
arguments/
apply would be "way slower" is still false.
function loopAnon(n) {
return function(f, args) {
for(var i = 0; i <= n; ++i) {
var res = f.apply(null, args);
}
}
}