Prototype chain: call “super” method over multiple levels

后端 未结 1 1476
礼貌的吻别
礼貌的吻别 2020-12-12 05:37

I have got the following prototype chain

  • SuperSuperClass
    • SuperClass
      • Class

each with a method named

1条回答
  •  庸人自扰
    2020-12-12 06:12

    What is the common approach for calling the respective super class method?

    Use .prototype..call(this). It's not only shorter, but also has the benefit of working in environments that don't support the non-standard __proto__ property.

    0 讨论(0)
提交回复
热议问题