So JSHint tells me I should not make functions within a loop. I then usually make a function outside the loop.
But now I have a part where this is more difficult:
for (r=0;r<x;r++) {
for (c=0;c<y;c++) {
var arr = [c,r];
setTimeout( (function(arr) { return function() { doSomething(arr); };})(arr), 50+c*550 + r*230 );
}
}
how could i refactor this part to not get the JSHint warning?