function runProcess(){
var todo = items.concat();
setTimeout(function(){
process(todo.shift());
if(todo.length > 0){
setTimeout(arguments.callee, 25);
} else {
callback(items);
}
}, 25);
}
I tried to refactor this block into a function
function doWork(todo){
process(todo.shift());
if(todo.length > 0){
setTimeout(arguments.callee, 25);
} else {
callback(items);
}
}
But this time given array repeats itself from the start
I think the problem occurs in arguments.callee,so what can i use instead of it?
Best Regards