1.原型链
2.call继承 Fn.call(this) 将Fn中的this替换
    // 2.改进 不采用原生链 改变指向
    function Parent() {
        this.name ='xiaoer';
        this.arr = [1];
        this.say = function () {
            console.log('haha');
            return 10;
        }
    }
    function Child() {
        Parent.call(this)
    }
    // 那么创建的所有的子类的实例其实创建的相同于父亲的实例
    var c1 = new Child();
    var c2 = new Child();
    c1.name = 'sb';
    c1.arr.push(2);
    console.log(c1.arr);
    console.log(c2.name);
    console.log(c1.say());
    // 因为创建的是两个父亲的实例因此引用型的数据互补影响
    // 借父类的构造函数来增强子类实例,等于是把父类的实例属性复制了一份给子类实例装上了(完全没有用到原型)
    // 无法实现函数复用,每个子类实例都持有一个新的fun函数,太多了就会影响性能,内存爆炸。。
3.冒充对象继承
function Parent() {
       this.name = 'xiaoer';
       this.age = 10;
   }
   Parent.prototype.height = 20;
   function Child() {
       var temp = new Parent();
       for(var key in temp) {
           if (temp.propertyIsEnumerable(key)) {
               this[key] = temp[key];
           }
       }
       temp = null;
   }
   var p = new Child();
特点:父类私有的和共有的都可以拿到
4.混合模式继承
function Parent() {
        this.name = 'xiaoer';
        this.speak = function () {
            console.log('english');
        }
    }
    function Child() {
        Parent.call(this)
    }
    Child.prototype = new Parent();
  Child.constructor = Parent;
    var p = new Child();
特点:子类的私有和公有有2份属性 父类对象执行了2次
5.寄生组合模式继承
function Parent() {
        this.name = 'xiaoer';
    }
    Parent.prototype.height = 200;
    function Child() {
        Parent.call(this)
    }
    Child.prototype = Create(Parent.prototype);
    var p = new Child();
    
    function Create(o) {
        function Fn() {}
        Fn.prototype = o;
        return new Fn;
    }
特点: 子类不仅继承了父类的私有的方法,而且子类的原型也仅仅继承了父类原型的方法
- 中间类继承法 不兼容 直接更改原型指向
 
function haha() {
        arguments.__proto__ = new Array();
        arguments.reverse();
        console.log(arguments);
    }
    haha(1,34,'xs');