继承

<!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Document</title>
    <script>
        function People(name){

            this.name=name;
        }
        People.prototype.showName=function(){

            console.log(this.name);
        }
        function Student(){
        }
        Student.prototype.study=function(){
            console.log("学习");         }
        var stu=new Student();        // stu.study();        //// stu.showName(); //Student.prototype         //console.dir(stu._proto_===Student.prototype)
        //console.dir(Student.prototype._proto_===People.prototype)         //console.dir(stu._proto_._proto_===People.prototype)         console.dir(stu._proto_._proto_._proto_._proto_)         console.dir(People.prototype._proto_._proto_._proto_)
        //Student.prototype         //People.prototype
       // function     </script> </head> <body>     </body> </html>
上一篇:PTA 翁恺 7-36 韩信点兵


下一篇:java串行流Stream