为什么要使用一个fn,而不直接在prototype上面搞
var $$ = ajQuery = function(selector) {
return new ajQuery.prototype.init(selector);
}
ajQuery.prototype = {
name: 'aaron',
init: function(selector) {
this.selector = selector;
return this;
},
constructor: ajQuery
}
ajQuery.prototype.init.prototype = ajQuery.prototype
ajQuery.prototype.say = function() {
$("#aaron").html(this.name)
}
$$().say()
为什么不这样写