Advanced
TypeScript
Q93 / 100
What does the "this" type (polymorphic this) returned from a method enable in a fluent/chainable API?
Correct! Well done.
Incorrect.
The correct answer is B) It allows subclass methods returning "this" to be correctly typed as the subclass type when chained
B
Correct Answer
It allows subclass methods returning "this" to be correctly typed as the subclass type when chained
Explanation
The polymorphic "this" type lets methods like "set()" in a builder pattern return the specific subclass type, preserving type information through chained calls on subclasses.
Progress
93/100