title: Does use of anonymous functions affect performance?
body: <p>I've been wondering, is there a performance difference between using named functions and anonymous functions in Javascript? </p>
  
  <pre><code>for (var i = 0; i &lt; 1000; ++i) {
      myObjects[i].onMyEvent = function() {
          // do something
      };
  }
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>function myEventHandler() {
      // do something
  }
  
  for (var i = 0; i &lt; 1000; ++i) {
      myObjects[i].onMyEvent = myEventHandler;
  }
  </code></pre>
  
  <p>The first is tidier since it doesn't clutter up your code with rarely-used functions, but does it matter that you're re-declaring that function multiple times?</p>