在中class,我如何访问其基类的私有字段#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}`)
潇潇雨雨
函数式编程
相关分类