摘要:
//使用原型工厂封装继承 function extend(sub,sup){ sub.prototype=Object.create(sup.prototype); Object.defineProperty(sub.prototype,"constructor",{ value:sub, enum 阅读全文
posted @ 2022-01-29 20:00
weakup
阅读(29)
评论(0)
推荐(0)
摘要:
//使用原型工厂封装继承 function extend(sub,sup){ sub.prototype=Object.create(sup.prototype); Object.defineProperty(sub.prototype,"constructor",{ value:sub, enum 阅读全文
posted @ 2022-01-29 19:54
weakup
阅读(21)
评论(0)
推荐(0)
摘要:
function User(name,age){ this.name=name; this.age=age; } User.prototype.show=function(){ console.log(this.name,this.age); } function Admin(...args){ / 阅读全文
posted @ 2022-01-29 19:46
weakup
阅读(74)
评论(0)
推荐(0)
摘要:
function Admin(){ Admin.prototype.showAdmin=function(){ return "admin"; } } function Enterprise(){ Enterprise.prototype.showEnterprise=function(){ ret 阅读全文
posted @ 2022-01-29 19:36
weakup
阅读(10)
评论(0)
推荐(0)
摘要:
function User(){} User.prototype.name=function(){ console.log("user.name"); } function Admin(){} //方式1 //Admin.prototype.__proto__==Object.prototype c 阅读全文
posted @ 2022-01-29 14:25
weakup
阅读(15)
评论(0)
推荐(0)
浙公网安备 33010602011771号