Tricky closure bug lurking in this delayed queue processor.
function runTasks(tasks, delay) {
for (var i = 0; i < tasks.length; i++) {
setTimeout(function() {
tasks[i]();
}, delay * i);
}
}
Reply with what is broken and how you would fix it.