Type Signature · #94 · 2026-07-07
What is the type of `r`?
TypeScript ·Difficulty 3/3
How to play
Read the TypeScript snippet and pick the correct type from four choices. Think about inference, narrowing, and utility types. Press 1–4 or click to answer.
class Builder {
private items: string[] = [];
add(item: string): this {
this.items.push(item);
return this;
}
}
class FancyBuilder extends Builder {
bold() { return this; }
}
const r = new FancyBuilder().add('x');
Loading your progress...
Press 1 through 4, or tap a numbered choice, to answer. Back to hub