title: JavaScript Proxy Pattern Explained
body: <p>I study JavaScript Proxy Pattern, but I still do not get, where I can benefit from it. I would therefore like to provide you with two examples and kindly ask you to point at the difference between them.</p>
  <p>Please, take a look at the code below:</p>
  <ul>
  <li>What is the difference between the two <code>addEventListener</code> calls? One of them calls <code>handleDrop</code> in regular way. The other uses Proxy Pattern.</li>
  <li>What will I gain using Proxy pattern approach?</li>
  </ul>
  <p>I tested both functions, and they both call <code>handleDrop</code> successfully.</p>
  <pre><code>DndUpload.prototype.buildDropZone = function ()
  {
      var self = this,
  
      this.dropZone.addEventListener('drop', function (e) { self.handleDrop.call(self, e) }, false);
      this.dropZone.addEventListener('drop', self.handleDrop, false);
  
  
      DndUpload.prototype.handleDrop = function (e)
      {
          alert(&quot;test&quot;);
          ...
      };
  }
  </code></pre>
  <p>You can provide me with good reference which contains very clear explanation of Proxy Pattern in JavaScript.</p>