title: Is There any Performance Difference in the Ways of Writing a jQuery Plugin?
body: <p>I'm curious, what are the (performance) differences in the ways that you can write a jQuery plugin, if any?</p>
  
  <p>I've seen it done a couple of ways:</p>
  
  <p><strong>1. Using <code>$.extend()</code>:</strong></p>
  
  <pre><code>(function($){
    $.fn.extend({
      newPlugin: function(){
        return this.each(function(){
  
        });
      }
    });
  })(jQuery);
  </code></pre>
  
  <p><strong>2. Your own function:</strong></p>
  
  <pre><code>(function($){
    $.fn.newPlugin = function(){
        return this.each(function(){
  
        });
    }
  })(jQuery);
  </code></pre>
  
  <p>IMHO the second way is a bit cleaner and easier to work with, but seems like there could be some advantage to writing it with <code>$.extend()</code>? Or am I over-thinking this, there is no discernible difference and it's just a matter of personal preference?</p>
  
  <p>(I would have thought this would have been asked before, but I can't find it -- if it's out there, please direct me to it)</p>