21 cards · Public · Shuffle

TypeScript - Advanced Types, Interfaces & Modern Development

Master TypeScript's advanced type system, generic abstractions, and compiler configurations to build scalable, bulletproof JavaScript applications.

Cards in this deck

(21 cards)

Preview terms and definitions before starting your study session.

#1
Term
Tuple Types
Definition
Fixed-length arrays where each element has a specific, known type at a designated index.
Example:
typescript1 line
type Response = [number, string]; // [200, "OK"]
#2
Term
Declaration Merging
Definition
A TypeScript feature where multiple interface declarations with the same name in the same scope automatically merge their definitions into a single combined interface.
#3
Term
Numeric vs String Enums
Definition
Enums define sets of named constants. Numeric enums auto-increment starting from 0 and support reverse mapping (Enum[0]). String enums require explicit string initializers for each member and do not support reverse mapping.
#4
Term
Interface vs Type Alias
Definition
interface defines object shapes and supports declaration merging (re-opening types). type aliases can represent objects, primitives, unions, intersections, and tuples, but cannot be re-opened once declared.
#5
Term
Discriminated Unions
Definition
A pattern for combining union types containing a common literal property (the "discriminant"). It allows TypeScript to automatically narrow down the specific type in conditional blocks.
Example:
typescript3 lines
type Action = 
  | { type: 'square'; size: number }
  | { type: 'rectangle'; width: number; height: number };
#6
Term
any vs unknown
Definition
any disables type checking completely, allowing any operation or property access without verification. unknown is a type-safe counterpart; values of type unknown cannot be accessed, called, or assigned to other typed variables without prior type narrowing or assertions.
#7
Term
The never Type
Definition
Represents the type of values that never occur. It is used for functions that never return (e.g., those that always throw errors or contain infinite loops) and for exhausting switch branches in type discrimination.
#8
Term
void vs undefined
Definition
void indicates that a function does not return a meaningful value (its return value is ignored). undefined is a concrete JavaScript primitive value representing an unassigned variable or explicitly missing return value.
Showing 8 of 21 cards in this deck.
Study All Now