Flashcard Deck · 21 cards · Public

TypeScript - Modern JavaScript Development & Type Safety

Master TypeScript's powerful type system, generics, utility types, and configuration to build scalable, type-safe web applications with confidence.

Cards in this deck

(21 cards)

Preview terms and definitions before starting your study session.

#1
Term
unknown vs. any
Definition
any disables all type checking. unknown is type-safe: it accepts any value, but forces type checking or narrowing before performing operations on that value.
#2
Term
never Type
Definition
Represents values that never occur. Commonly used for functions that always throw an exception, contain infinite loops, or to enforce exhaustive checks in switch cases.
#3
Term
TypeScript Compilation Process
Definition
TypeScript is a statically typed superset of JavaScript. The TypeScript compiler (tsc) performs type checking at compile time and transpiles .ts files down to plain JavaScript, removing all type annotations for execution.
#4
Term
tsconfig.json
Definition
The central configuration file for a TypeScript project. It specifies root files and compiler options, such as target (JavaScript version output), module system, strict mode flags, and outDir.
#5
Term
Primitive Types in TypeScript
Definition
Built-in basic types corresponding directly to JavaScript primitives: string, number, boolean, null, undefined, symbol, and bigint.
#6
Term
Union Types (|)
Definition
A construct that allows a variable to hold values of two or more distinct types. For example: let id: string | number; allows id to be either a string or a number.
#7
Term
Intersection Types (&)
Definition
Combines multiple types into one, requiring an object to satisfy all constituent properties. Example: type AdminUser = User & Permissions;.
#8
Term
Interface vs. Type Alias
Definition
interface defines object shapes and supports declaration merging (can be extended/re-opened). type (Type Alias) creates a name for any type, including primitives, unions, tuples, and objects, but cannot be re-opened.
Showing 8 of 21 cards in this deck.
Study All Now