I see in jQuery something like this:
jQuery.fn = jQuery.prototype = {}
Why is this being done? Isn't this the same thing just saying jQuery.prototype = {}? I'm not sure I understand what Resig is accomplishing here.
The same as:
jQuery.prototype = {}
jQuery.fn = jQuery.prototype
In my opinion having all in one line makes more clear that your assigning the same value to both variables
This is equivalent to:
jQuery.prototype = {}
jQuery.fn = jQuery.prototype
In other words jQuery.fn and jQuery.prototype both point to the same object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With