首页 > 其他 > 详细

new 做了什么

时间:2019-05-21 13:05:13      阅读:144      评论:0      收藏:0      [点我收藏+]
    var a=function(){
      this.che1 = function () { console.log(1) }
      this.che2 = function () { console.log(2) }
      this.che3=function(){console.log(3)}
    }
    var b= new a();
    var c={};
    
    c.__proto__ = a.prototype;
    a.call(c);

    console.log(b)
    console.log(c)

  技术分享图片

技术分享图片

 

new 做了什么

原文:https://www.cnblogs.com/dianzan/p/10899045.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!