I am having an issue with the way binding is explained in the appendix
of MooTools Essentials. It states that the 'this' in the function
below should reference the Array instance that is calling it (in this
case an anonymous array). When I run an example like this (MooTools
1.2.3, Firefox 3.5.1), 'this' is always referenced to Window.

['blue','green','yellow'].each(function(value, index){
  alert('item ' + index + ' is ' + value);
  if (index == this.length-1) this[index] = 'orange';
  //Changes the last item in the array to 'orange'
});

Am I missing something here?

Reply via email to