js对象中自身声明的方法和属性与prototype声明的对象有什么差别

2025-04-04 06:04:46
推荐回答(1个)
回答(1):

function aa(){this.name="jok"}var bb=new aa();bb.prototype=aa.prototype;alert(aa.prototype)alert(bb.prototype) bb.prototype 等于aa 而aa.prototype才是对象