对象继承

;(function () {
var o = {
inheritObject:function (obj) {
var F = function () {}
F.prototype = obj;
return new F();
},
inheritPrototype:function (subclass, superclass) {
var o = this.inheritObject(subclass.prototype);
o.constructor = subclass;
subclass.prototype = o;
}
}
window.objUtil = o;
})();

posted @ 2018-07-27 09:08  Aoeuy  阅读(120)  评论(0编辑  收藏  举报