20171215.05

来源:互联网 发布:李喆工笔画网络班 编辑:程序博客网 时间:2024/06/05 11:23
<!doctype html><html lang="en"><head>    <meta charset="UTF-8">    <title>Document</title></head><body><script>    /*        原型:                prototype:  类似于css中的class    */    function Person(name,age){        this.name =name ;        this.age  =age ;        this.say = function(){            alert(this.name)        }    }    let p1 = new Person("ex",12);    let p2 = new Person("rt",17);    console.log(p1 == p2);    console.log(p1.say == p2.say);    p1.say();    p2.say();</script>   </body></html>
原创粉丝点击