nicolaasmatthijs/3akai-ux — comment on commit 92388f645a85591df7fc5ce7017dec348daa7c9b
File: tests/qunit/tests/unit/js/cleanjs.js line 47
By stuartf:

I don' t know that I'd call it incorrect because the JQuery.each takes a function as an argument, and the places where this is thrown we're defining an anonymous function there, which is inefficient. The trick to fixing them would be to refactor from:
for(){
$.each(foo, function(k, v){// do stuff});
}
to:
var mapProcessor = function(k, v){// do stuff};
for (){
$.each(foo, mapProcessor);
}

Of course it's not so easy in practice because the mapProcessor function often needs stuff that's inside the loop scope.