var jQuery = function(global, factory) { return new jQuery.fn.init();}jQuery.fn = jQuery.prototype = { constructor: jQuery, init: function() { this.jquery = 3; return this; }, each: function() { console.log('each'); return this; }}jQuery.fn.init.prototype = jQuery.fn;// init構造函數jQuery().each().each()上面是一段jQuery源碼,我的問題是為什么代碼最后一行的第二個each函數還能夠執行
jquery中的原型鏈
長風秋雁
2018-11-29 16:15:38