What is the static keyword in TypeScript Classes?
ClassName.member (not this.member).new to access.Distinguish between Static and Instance members.
User.count).user.email).this.Name two advanced TS/JS features of static beyond simple properties.
static { ... } for complex, one-time initialization logic.User.fromJSON(data)).When is using static considered a “code smell” or bad practice?
Tip for the Assessment:
If an evaluator asks you to refactor a class full of static methods that don’t share data, suggest moving them to standalone functions.
This is the “functional” approach preferred in modern React/TS environments because it results in smaller bundle sizes.
What is a TypeScript Abstract Class and when is it used?
new X() fails).abstract have no body; subclasses must implement them.How do Abstract Classes differ from Interfaces in TS?
When is an Abstract Class considered “poor” design in modern React?
What is the primary technical difference between interface and type?
string | number), Tuples, and Primitives. Better for Complex Logic and Function Signatures.interface is slightly faster for the TS compiler to check in large codebases.What is a Discriminated Union and why is it used in React?
{ type: 'success', data: T } | { type: 'error', error: string }What do keyof and Record<K, T> do?
"id" | "name").K to values T.When is using any or non-null assertion (!) considered a “Fail”?
unknown + Type Guard instead.?.) or Nullish Coalescing (??).