A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-32.ts
1classA{_v=0;setx(n:number){this._v=n*2;}}
2classBextendsA{setx(n:number){super.x=n+1;}}
3constb=newB();b.x=5;
4console.log(b._v);
Classes
Answer & explanation
Console output
12
Why
Writing `super.x = value` invokes the parent class`s setter with `this` bound to the current instance. B`s setter forwards 5+1 = 6 to A`s setter, which stores 6 * 2 = 12 in `this._v`. super on the left of an assignment dispatches to the inherited setter, enabling layered write logic.