I have an inheritance like this:
(我有这样的继承:)
class Parent {
some_object_property = ["some_object_property_depending_on_initialization"];
constructor() {...}
}
class Child extends Parent {
some_object_property = [...super.some_object_property, 'child_property']
}
Is there a way to let the Child
inherit and extend object property some_object_property
from the Parent
?
(有没有办法让Child
从Parent
继承和扩展对象属性some_object_property
?)
I know I can achieve the end result through getter
and setter
.
(我知道我可以通过getter
和setter
达到最终结果。)
Is there a more direct way?(有没有更直接的方法?)
ask by 北美38fule translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…