jQuery Object Inheritance
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1755080/why-jquery-do-this-jquery-fn-init-prototype-jquery-fn">Why jQuery do this: jQuery.fn.init.prototype = jQuery.fn?</a>  </p>
</blockquote>



<p>I am reading through the jquery source and am confused early on. As it is, the jQuery function returns a "new jQuery.fn.init(selector,context);". Then jQuery.fn = jQuery.prototype, which contains the init function. Finally, jQuery.fn.init.prototype = jQuery.fn. </p>

<p>Main question:
Why did the designers not just have the jQuery function return "new jQuery.fn(selector,context)" and have init and the other functions in jQuery.prototype (i.e. jQuery.fn) be in jQuery.fn.prototype?</p>

<p>Secondary concern:
I don't see the point in setting jQuery.prototype at all considering you never call "new jQuery(s,c)"... the jQuery (i.e. $) object is just a wrapper on jQuery.fn to hide calling "new" in code, since it is prettier to say "$('div').foo()" than "new $('div').foo()"</p>
