在检查jQuery对象时,我注意到jQuery将一些方法放在实际的jQuery实例本身上。其他关于jQuery对象的原型对象。有谁知道jQuery为什么会这样做(性能......等)?
console.dir(jQuery.prototype)
------------------
▼ Object
add: function(){....}
addBack: function(){...}
addClass: function(){...}
after: function(){....}
.....more methods
console.dir(jQuery)
----------------------
▼ Object
Animation: function(){...}
Callbacks: function(){....}
Deferred: function(){.....}
Event: function(){....}
Tween: function(){.......}