Skip to Content
Skip to content
Tutorials

Programming Tutorials

Standalone programming tutorials for solving one specific problem at a time. Each guide starts with the exact error message, failing behavior, or design constraint, gives you a minimal reproducible script or query, and walks through the fix with real output.

Pick a language below or filter by topic and difficulty when you need a quick, practical reference you can test locally and apply right away.

HTML and CSS
Audit Contrast and Focus Paths Before You Ship Level: Advanced

Measure contrast by number, run axe, and walk the keyboard focus path with a script to catch what the tool cannot see.

TypeScript
Fix "Cannot find name" After Renaming a .js File Level: Beginner

Install the Node types, turn them on in tsconfig.json, and switch require to import. Also covers the other causes of the same error: a typo, a missing import and a missing lib.

TypeScript
Find Which TypeScript Compiler Your Project Runs Level: Beginner

Trace a compiler version mismatch, confirm the resolved package path, and make a project-local check catch a deliberate type error.

TypeScript
Narrow a Union With typeof and in Level: Beginner

Use typeof, in and Array.isArray on three real unions, and avoid the two mistakes that stop narrowing from working. After this, you know which check fits which union.

TypeScript
Read a TypeScript Error Message Without Guessing Level: Beginner

Read an error in three passes and match the eight most common phrases to their causes, using real tsc output. After this, a wall of errors is a list you can work through.

TypeScript
Function Return Types That Catch Missing returns Level: Beginner

Let a declared return type find a branch with no return, an arrow function with braces, and an async function typed wrong.

TypeScript
Stop Using any: Replace It in 10 Minutes Level: Beginner

Find every any, then replace each one with a named type, a function type or unknown with a check. After this, a typo like prise is a compile error instead of NaN.

TypeScript
tsconfig strict: Turn It On Without 200 Errors Level: Beginner

Count what each strict flag costs, turn them on one at a time, park one stubborn error with ts-expect-error, and finish with strict true.

TypeScript
Type an Object Without Copy-Pasting the Shape Twice Level: Beginner

Write an object shape once with type, derive one from an existing object with typeof, and share it between files with import type.

TypeScript
Union Types Without Nested if Soup Level: Beginner

Flatten nested ifs with early returns, let a switch tell you when you forgot a case, and use a lookup object for word-to-text mappings.

TypeScript
Discriminated Unions for success and error Responses Level: Intermediate

Replace a data-or-error object with a union tagged by success, then add a generic Outcome and an unwrap helper. After this, the compiler knows which property exists in each case.