title: Detecting changes in a Javascript array using the Proxy object
body: <p>It is relatively trivial to watch for changes in an array in Javascript.</p>
  
  <p>One method I use is like this:</p>
  
  <pre><code>// subscribe to add, update, delete, and splice changes
  Array.observe(viewHelpFiles, function(changes) {
    // handle changes... in this case, we'll just log them 
    changes.forEach(function(change) {
      console.log(Object.keys(change).reduce(function(p, c) {
        if (c !== "object" &amp;&amp; c in change) {
          p.push(c + ": " + JSON.stringify(change[c]));
        }
        return p;
      }, []).join(", "));
    });
  });
  </code></pre>
  
  <p>However, I have recently read that <code>Array.observe</code> is deprecated and we should use the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe">proxy object instead.</a> </p>
  
  <p>How can we detect changes in an array the Proxy object? I am unable to find any examples, anyone interested in elaborating?</p>