在中class,我如何訪問(wèn)其基類(lèi)的私有字段#property?class Base { #property = '1.618' toString() { return Base.name }}class X extends Base { thisWorks() { return super.toString() } toString() { return super.#property // SyntaxError: Unexpected private field }}console.log(`${new X}`)
如何在JavaScript中訪問(wèn)超類(lèi)的私有成員?
慕運(yùn)維8079593
2021-04-26 16:19:05