美文网首页
面对对象

面对对象

作者: King小志 | 来源:发表于2017-10-11 16:23 被阅读0次

    ###  1

     console.log(dog instanceof Dog)  判断dog是不是Dog的对象(实例)

    ###  2  

    属性是否只存在对象中  用  对象.hasOwnProperty("属性") 

    构造函数的  原型  用  prototype  对象用 _proto_

    ### 3

    Array 中 新增一个方法x,可以压入一个元素

    Array.prototype.x1=function(a){

    this.push(a)

    }

    相关文章

      网友评论

          本文标题:面对对象

          本文链接:https://www.haomeiwen.com/subject/ghvwyxtx.html