37
As an example, copied from jQuery 1.2.6:
jQuery.fn = jQuery.prototype = {
init: function( selector, context ) {
// Make sure that a selection was provided
selector = selector || document;
..........
},
};
I have read some posts here like JavaScript: What are .extend and .prototype used for? and know a prototype can be used in a subclass to extend some methods.
But I cannot understand the usage in the above snippet from jQuery.
Are there any canonical documents describing the prototype?
Thanks.