title: How to watch for array changes?
body: <p>In Javascript, is there a way to be notified when an array is modified using push, pop, shift or index-based assignment? I want something that would fire an event that I could handle.</p>
  
  <p>I know about the <code>watch()</code> functionality in SpiderMonkey, but that only works when the entire variable is set to something else.</p>