为了账号安全,请及时绑定邮箱和手机立即绑定

重写原型对象之后,为什么最初的原型对象还会存在

重写原型对象之后,为什么最初的原型对象还会存在

小怪兽爱吃肉 2018-09-08 10:39:13
        function Person(){}        var friend=new Person();        console.log(Person.prototype);                     Person.prototype={                                     constructor:Person,            name:'ytf',            age:'20',            job:'student',            sayName:function(){                console.log(this.name);             }         }        console.log(Person.prototype);        console.log(friend.sayName());
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 577 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信