A complete TypeScript installation guide — setting up Node.js and npm, global vs local installation, tsconfig.json configuration, compiling your first file, and using ts-node for direct execution without a build step.
A guide to TypeScript's core syntax — type annotations, typed functions, interfaces, classes, union types, type aliases, enums, generics, modules, tuples, decorators, optional chaining, and nullish coalescing for writing safer, more structured code.
A complete guide to comments in TypeScript — single-line, multi-line, JSDoc for automatic documentation, compiler directive annotations like @ts-ignore and @ts-expect-error, best practices for writing meaningful comments, and comment anti-patterns to avoid.
A complete guide to variables in TypeScript — the difference between let, const, and var and their scoping implications, type inference vs explicit annotations, the dangers of the any type and safe alternatives, proper null and undefined handling with strictNullChecks, destructuring, and good variable naming conventions.
A complete guide to constants in TypeScript — const and its immutability limits, Object.freeze and Readonly for deep immutability, const assertions with as const, literal types, enums as constant groups, organizing constants in modules, and application configuration management patterns.
A complete guide to the TypeScript type system — the primitive types number, string, boolean; the special types any, unknown, never, void, null and undefined; the structural types array, tuple, object; and the composition types union and intersection along with correct narrowing patterns.
A complete guide to operators in TypeScript — arithmetic operators and floating-point traps, the crucial difference between == and === in the TypeScript context, short-circuit logical operators, nullish coalescing and optional chaining, the typeof and instanceof type operators for narrowing, bitwise operators, and TypeScript-specific operators like as and satisfies.
A complete guide to conditional branching in TypeScript — if-else with automatic type narrowing, switch-case with exhaustive checks, the ternary operator, custom type guards with is and assertion functions, discriminated unions as a conditional alternative, and the early return pattern for simplifying branching logic.
A complete guide to loops in TypeScript — the classic for loop with index type safety, while and do-while for dynamic conditions, for-of as the primary choice for array iteration, the dangers of for-in and its alternatives, functional array methods map filter reduce, generators and custom iteration, and async iteration patterns for data streams.
A complete guide to functions in TypeScript — function declarations vs arrow functions and their this differences, optional and default parameters, rest parameters, overloading with separate signatures, higher-order functions and closures, generic functions, async-await functions with correct error handling, and function types plus function-related utility types.
A complete guide to classes in TypeScript — property declarations and constructor shorthand, access modifiers public private protected, getters and setters, inheritance with extends and super, static members, abstract classes as implementation contracts, implementing interfaces, the mixin pattern, and SOLID principles for good class design.
A complete guide to interfaces in TypeScript — the difference between interfaces vs type aliases and when to choose each, optional and readonly properties, interfaces for functions and callables, index signatures, extends for hierarchy composition, class implementation, declaration merging, and interface-based utility types like Partial, Required, Pick, and Omit.
A complete guide to exception handling in TypeScript — try-catch-finally with safe unknown typing, custom error classes with a hierarchy, the Result pattern as an alternative to throw-catch, assertion functions, correct re-throwing, async-await error handling, global error boundaries, and strategies for choosing between throw vs Result based on context.
A complete guide to arrays as lists in TypeScript — declaration and type inference, safe access with noUncheckedIndexedAccess, mutation vs immutability with the spread operator, functional methods map-filter-reduce-flatMap, searching with findIndex-find-includes, sorting with comparators, Set for unique collections, multidimensional arrays, and ReadonlyArray for data protection.
A complete guide to Map in TypeScript — declaring Maps with type parameters, type-safe CRUD operations, the difference between Map vs plain objects and when to choose each, non-string keys including objects and functions, WeakMap for automatic memory management, common patterns like caching and frequency counters, converting between Map and arrays/objects, and ReadonlyMap for immutability.
A complete guide to Date & Time in TypeScript — the pitfalls of the zero-based month in the Date constructor, getter and setter methods, formatting with Intl.DateTimeFormat for Indonesian localization, time difference calculations and duration addition, correct timezone handling, ISO 8601 serialization, branded types for date type safety, and when to switch to date-fns or the Temporal API.
A complete guide to regular expressions in TypeScript — literal vs RegExp constructor syntax, all string and RegExp methods with their return types, all flags including the modern d s v flags, special characters and quantifiers, capturing groups and named groups, lookahead and lookbehind, the g-flag and lastIndex trap with exec, and common validation patterns for email, Indonesian phone numbers, NIK, and URLs.
A complete reference of all regex identifiers in TypeScript — literal and escape characters, the dot caret dollar metacharacters, character classes and predefined character classes including Unicode property escapes, greedy vs lazy quantifiers, all grouping and capturing variants including named groups and atomic groups, alternation, boundary assertions, positive and negative lookahead and lookbehind, plus a quick-reference table of all identifiers.
A complete guide to tsconfig.json — the file structure and how to generate it, all important compilerOptions with their practical implications, strict type-checking options, managing path aliases with baseUrl and paths, configuration for different environment targets Node.js vs browser vs library, extends for sharing configuration, project references for monorepos, plus ready-to-use templates for common projects.
A complete guide to vendoring in TypeScript — definition and historical context, when vendoring is appropriate and when it isn't, good vendor directory structure, tsconfig.json configuration for vendor paths, writing type declarations for untyped JavaScript libraries, vendoring with npm pack and lockfiles as alternatives, supply chain attack risks and mitigations, plus a comparison of vendoring vs dependency pinning vs private registries.