A for loop is run in local scope, while an arrayUtil.forEach(function(xxx)) is not and needs the context.