zoukankan      html  css  js  c++  java
  • 后盾人:JS课程第十一章(原型)

    1.原型

     原型体现

        let arr = [] //new Array
        console.log(arr.__proto__ == Array.prototype); //true
    
      //同理,也适用{}-Object、“”-string、123-number、true-Boolean、/a/i - RegExp..

    Object.setprototypeOf(a, b)    //修改 a 对象原型__proto__为 b 。第一个为被设置对象,第二个为原型父级

    Object.getprototypeOf( a )      // a 对象原型

    a.constructor           //找到 a 对象父级原型

    a instanceof b          //检验 b 是否在 a 的所有原型链中 返回布尔

     b.isPrototypeOf( a )          // b 是否在 a 的原型链上  返回布尔

    Object.create( a )        //创建一个新对象,并用a作为新的proto

    mixin 多继承

    object.assign( 对象, 属性)   //合并对象和属性    

    super = this.__proto__ 

  • 相关阅读:
    1221D
    1249E
    D. Yet Another Monster Killing Problem
    大佬传送门
    Zookeeper客户端连接报错
    搭建PXC集群
    Docker分布式环境
    Docker使用
    Docker入门
    MySQL数据库集群概述
  • 原文地址:https://www.cnblogs.com/jidanbufan/p/15239359.html
Copyright © 2011-2022 走看看