title: Array change listener
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/572604/javascript-how-to-extend-array-prototype-push">Javascript - How to extend Array.prototype.push()?</a>  </p>
  </blockquote>
  
  
  
  <p>How can I be notified (run a pre-defined function) of any change to a registered array (or at least any addition or removal of elements)?
  I tried using prototype.  I don't want to be scolded for not providing SOME code examples of my own. So here's how I would <em>like</em> to use it.</p>
  
  <pre><code>var myArray = [];
  myArray.bind(function() {
      console.log('wtf'); // Wed Thu Fri and what were you thinking?
  });
  </code></pre>
  
  <p>I don't need overkill. I basically know the Array function scope that I will be using (push, pop, splice and maybe a couple others). It's a way to use backbone's MVC. I want to run logic on an array and THEN have the views highlighted accordingly. But the view is already attached to a collection. Any change to that collection re-renders the actual DOM's in the view. I don't want that. I simple want to add, or remove, a class to the corresponding DOM's in the view for CSS purposes.</p>