A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-69.ts
1classBase{add(a:number,b:number){returna+b;}}
2classSubextendsBase{add(a:number){returna*2;}}
3consts:Base=newSub();
4console.log(s.add(5,9));
Classes
Answer & explanation
Console output
10
Why
TypeScript allows an override to declare fewer parameters because a function can always be called with extra arguments that JavaScript ignores. At runtime the call dispatches to Sub.add, which only uses the first argument: 5 * 2 = 10, and the second argument 9 is silently discarded. Parameter count is a compile-time signature concern, not a runtime constraint.