This can be confusing. But remember, you're not passing current_index here, you're defining a function, which has a closure, and via that closure, has access to the variable current_index, in the parent scope.

.on("start", function(){
tick(current_index); // you have access to this because of the closure
});

So if you change the value of current_index, whatever current_index is when that anonymous function you created there executes, that's what will be passed to tick().

This is one of the reasons why creating functions inside of for loops is dangerous. You'll need to either use an immediately invoked function that takes current index as an arg, and returns the function you want .on to execute. Or you can bind the function you are passing:

.on("start", function(boundIndex){
tick(boundIndex); // now the value at the time of binding is bound
}.bind(null, current_index);

Email codedump link for Why is this primitive variable being passed to a function by reference instead of by value?