TypeScript Foundations
45‑60 hours · 15 modules · 89 lessons · Project: TaskKit
M1 · 6 lessonsGetting Started
- 1.1What a program is and how a computer runs itUp next
- 1.2Your setup: VS Code, Node.js, and basic terminal commands
- 1.3Hello, world: running your first
.tsfile (and the online Playground) - 1.4Two tools, two jobs: Node runs your code, TypeScript checks it
- 1.5Your first error message: how to read it without panic
- 1.6Where to find answers: docs, MDN, and AI assistants used wisely
- Project stepPrint a TaskKit welcome banner.
M2 · 8 lessonsValues and Variables
- 2.1
constandlet - 2.2Basic types:
string,number,boolean - 2.3Arithmetic, comparisons, and template strings
- 2.4Working with strings: common methods
- 2.5Number pitfalls: NaN, floating point, and Math
- 2.6Inference: when TypeScript knows the type and when to write it yourself
- 2.7Comments and names: writing code other people can read
- 2.8Your first input: command-line arguments with
process.argv - Project stepTaskKit reads a command and a task name from the command line.
M3 · 5 lessonsConditions and Missing Values
- 3.1
if/elseandswitch - 3.2Logical operators, truthy and falsy values
- 3.3
nullandundefined - 3.4Optional chaining
?.and nullish coalescing?? - 3.5Checking for
null: a first look at narrowing - Project stepValidate input and print helpful messages.
M4 · 7 lessonsArrays and Loops
- 4.1Arrays and the
T[]type - 4.2
for,for...of, andwhile - 4.3
map,filter,find,some, andevery - 4.4Sorting and its pitfalls
- 4.5
reduce - 4.6Simple tuples
- 4.7Reading code: tracing a loop by hand
- Project stepKeep tasks in a list, refuse a task typed twice, and sort them A to Z.
M5 · 11 lessonsFunctions
- 5.1Declaring functions: parameter and return types
- 5.2Arrow functions
- 5.3Optional, default, and rest parameters
- 5.4Functions as values: callbacks and function types
- 5.5Scope and closures (basics)
- 5.6
void: functions that return nothing - 5.7Breaking a problem into small functions, starting from plain-language steps
- 5.8The call stack: what happens when functions call functions
- 5.9Recursion: a function that calls itself (a gentle first look)
- 5.10The debugger: stepping through a function
- 5.11Checking your work: your first test with
node:test - Project stepRefactor TaskKit into small, tested functions.
M6 · 10 lessonsObjects and Collections
- 6.1Objects and object types
- 6.2Optional and
readonlyproperties - 6.3Type aliases (
type) - 6.4Interfaces and
extends - 6.5
typeorinterface: a simple rule for choosing - 6.6Structural typing: shapes, not names; excess property checks
- 6.7References vs copies: why changing one object changes another
- 6.8Destructuring and spread (and why spread is shallow)
- 6.9Iterating over objects:
Object.keysandObject.entries - 6.10Dictionaries and collections:
Record,Map, andSet - Project stepTasks become objects with an id, a title, and an optional due date.
M7 · 6 lessonsUnions and Narrowing
- 7.1Union types
- 7.2Literal types and unions of literals (
"todo" | "done") - 7.3Narrowing with
typeof, equality, and truthiness - 7.4Narrowing with the
inoperator - 7.5Discriminated unions
- 7.6Enums: reading them in other people's code, and why modern code prefers literal unions
- Project stepTask status becomes a union; commands become a discriminated union.
M8 · 6 lessonsErrors and Debugging
- 8.1A catalogue of common TypeScript errors and how to fix them
- 8.2Type errors vs runtime errors: why types vanish when the code runs
- 8.3
throwandtry/catch - 8.4Where to throw and where to catch: friendly errors for bad commands
- 8.5
anyvsunknown: the escape hatch and the safe box - 8.6Debugging strategies:
console, breakpoints, isolating the problem - Project stepFriendly error messages for bad commands.
M9 · 4 lessonsModules, Packages, and Projects
- 9.1
importandexport:"type": "module",.tsextensions,import type - 9.2npm and
package.json: installing packages and writing scripts - 9.3Types for packages:
@typesand thetypessetting - 9.4A ready-made
tsconfig.json:strict, and the flags that keep TypeScript in sync with Node - Project stepSplit TaskKit into modules and add
check,test, andstartscripts.
M10 · 2 lessonsReading Generic Types
- 10.1What
<T>means:Array<T>andMap<K, V> - 10.2Your first generic function
- Project stepStore tasks in a
Map<string, Task>and write a genericfindByhelper.
M11 · 6 lessonsAsynchronous Code
- 11.1What asynchronous code is and why it exists
- 11.2The event loop, in pictures
- 11.3
Promise<T> - 11.4
async/await - 11.5Errors in async code:
tryaroundawait - 11.6Catching what you do not
await:.catchandunknown - Project stepAdd a
delay()helper and a reminder that waits before it prints.
M12 · 5 lessonsTalking to the Outside World
- 12.1JSON:
parseandstringify, and whyJSON.parsereturnsany - 12.2Reading and writing files:
readFileandwriteFile - 12.3Interactive input with
readline - 12.4
fetch: getting data from a web API - 12.5Why an API response type doesn't guarantee what the data really looks like
- Project stepSave tasks to a JSON file; add an interactive mode.
M13 · 3 lessonsClasses: The Basics
- 13.1Classes: properties, constructors, and methods
- 13.2
private,#private, andreadonly: TypeScript privacy vs JavaScript privacy - 13.3When to use classes, and when functions and objects are enough
- Project stepMove task storage into a
TaskStoreclass with#privatedata and public methods.
M14 · 6 lessonsPopular Libraries, Step One
- 14.1Why libraries exist, and how to choose one: popularity, maintenance, built-in types or
@types - 14.2Staying safe: lockfiles, pinned versions, and what a supply-chain attack is
- 14.3
chalk: colors in the terminal - 14.4
commander: a real command-line interface - 14.5
date-fns: working with due dates - 14.6
lodash: ready-made helpers, with types from@types/lodash - Project stepTaskKit gets colored output, proper commands, and due dates.
M15 · 4 lessonsFinal Project
- 15.1Finish TaskKit: add a feature that fetches data from an API, and write a README
- 15.2Git on your computer: commits and a
.gitignore - 15.3Ship TaskKit: publish it on GitHub with a README and a short demo recording
- 15.4Self-assessment: are you ready for Level 2?
- Project stepShip TaskKit: publish it on GitHub with a README and a short demo recording.
- TipAfter lessons 15.2 and 15.3, Bonus A's Git lesson takes it further: history, branches, and pull requests.