javascript中所有的类都直接的或间接的继承于Object类,该类是根类。

       子类继承基类可通过prototype实现,代码如下:

       //Person 类

       function Person(myName.myAge){

       this.name=myName;

       this.age=myAge

      }

      //基类

       function Child(){}

       Child.prototype=new Person();

      至此,基于原型的继承实现。