function Person(){"use strict";Person.prototype={ name:"Nooo", age:29, job:"software enginner", sayName:function () { alert("哈哈哈"); }}}var obj=new Person();obj.name undefined但是放在function的外面却可以访问prototype属性function Person(){}Person.prototype={construct:Person,name:"Nooo",age:29,job:"software enginner",sayName:function () { alert("哈哈哈");}}请问这两种方式的差别是什么?第一种方式哪里有问题
添加回答
举报
0/150
提交
取消