I attempted the following steps:
class Child {
public func() {
alert("hello");
}
constructor() {
Parent.apply(this, arguments);
}
}
Child["prototype"] = Object.create(Parent.prototype)
Child["prototype"].constructor = Child;
However, when I create an instance of the Child class, it does not have the func() method.
Can someone provide guidance on how to properly implement inheritance in JavaScript classes?