Code QuizIntermediate Using this Before super
Finding why a subclass constructor breaks when touching this too early.
Codetypescript
class Base {
constructor(public id: number) {}
}
class Item extends Base {
label: string;
constructor(id: number, label: string) {
this.label = label;
super(id);
}
}
const i = new Item(1, "box");What is the bug in this code?