var jQuery = function( selector ) {
return new jQuery.fn.init( selector );
};
jQuery.fn = jQuery.prototype = {...};
var init = jQuery.fn.init = function( selector ){
this.selector = selector;
this.element = document.querySelector(this.selector);
};
console.log(
jQuery('div').selector
);
I'm currently study how jQuery works, but I got few questions
jQuery.fn = jQuery.prototype = {};whyprototype = object, isn't prototype usually come with name afterjQuery.prototype.foo = function...var init = jQuery.fn.init (jQuery.prototoype.init)when I removevar init, i got an error, like this :var jQuery.fn.init = ...