function User(){}
    User.__proto__.view=function(){
        console.log("user function");
    }
    User.prototype.show=function(){
        console.log("后盾人");
    }

    user.view();
    console.dir(User);
    // __proto__服务于函数对象的

    // prototype服务于函数实例化的

    let hd=new User();
    hd.show();

 

posted on 2022-01-27 13:59  weakup  阅读(37)  评论(0)    收藏  举报