ES6 類多重繼承 - ES6 Class Multiple inheritance

問題:

I've done most of my research on this on BabelJS and on MDN (which has no information at all), but please feel free to tell me if I have not been careful enough in looking around for more information about the ES6 Spec.我已經在BabelJSMDN (根本沒有任何信息)上完成了我的大部分研究,但是如果我在四處尋找有關 ES6 規範的更多信息時不夠小心,請隨時告訴我。

I'm wondering whether or not ES6 supports multiple inheritance in the same fashion as other duck-typed languages do.我想知道 ES6 是否像其他鴨子類型語言一樣支持多重繼承。 For instance, can I do something like:例如,我可以做這樣的事情:

class Example extends ClassOne, ClassTwo {
    constructor() {
    }
}

to extend multiple classes on to the new class?將多個類擴展到新類? If so, will the interpreter prefer methods/properties from ClassTwo over ClassOne?如果是這樣,解釋器會更喜歡 ClassTwo 的方法/屬性而不是 ClassOne 嗎?


解決方案:

參考一: https://en.stackoom.com/question/21Mxf
參考二: https://stackoom.com/question/21Mxf
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章