I implement looping with a callback using call() function (example from http://ejohn.org/apps/learn/#28, see below)
function loop(array, fn){
for ( var i = 0; i < array.length; i++ )
fn.call( array, array[i], i );
}
To modify contents of the array, I can use
var a = [0,1,2]
loop(a, function(v, i) { this[i] = 0; }); // a = [0,0,0]
but not
var a = [0,1,2]
loop(a, function(v, i) { v = 0; }); // a = [0,1,2]
Why does that happen? this is array, so this[i] and array[i] and v are the same. However, in one case the array is modified, in another it stays immutable.