首页 > 代码库 > js原型继承

js原型继承

 function Person() {

    }

    Person.prototype.dance = function () {

    }
    function Ninjia() {


    }
    Ninjia.prototype = new Person();
    var ninjia = new Ninjia();

 

js原型继承