Skip to content

Typescript - Wyatt's Notes

Typescript programming language notes covering fundamentals, advanced concepts, and practical examples.

sources:

  • text: Standard textbook reference

Typescript is a programming language with a rich type system and ecosystem. These notes cover the language from fundamentals to advanced topics, with worked examples, practice problems, and flashcards.

Topics

Advanced patterns

Typescript advanced patterns notes covering key definitions, core concepts, worked examples, and practice problems.

Advanced types

Typescript advanced types notes covering key definitions, core concepts, worked examples, and practice problems.

Classes

Typescript classes notes covering key definitions, core concepts, worked examples, and practice problems.

Enums and modules

Typescript enums and modules notes covering key definitions, core concepts, worked examples, and practice problems.

Error handling

Typescript error handling notes covering key definitions, core concepts, worked examples, and practice problems.

Flashcards typescript basics

Typescript flashcards typescript basics notes covering key definitions, core concepts, worked examples, and practice problems.

Functions

Typescript functions notes covering key definitions, core concepts, worked examples, and practice problems.

Generics

Typescript generics notes covering key definitions, core concepts, worked examples, and practice problems.

Practice typescript basics

Typescript practice typescript basics notes covering key definitions, core concepts, worked examples, and practice problems.

Tooling and configuration

Typescript tooling and configuration notes covering key definitions, core concepts, worked examples, and practice problems.

Types and annotations

Typescript types and annotations notes covering key definitions, core concepts, worked examples, and practice problems.

Typescript with react

Typescript typescript with react notes covering key definitions, core concepts, worked examples, and practice problems.

Intuition

TypeScript is like having a spell-checker for your code. Just as a spell-checker catches typos before you send an email, TypeScript catches type errors before your code runs. This early detection saves time because fixing bugs during development is cheaper than fixing them in production.

The TypeScript ecosystem is like a toolbox with specialized tools. Each tool (library, framework, pattern) is designed for a specific task, and knowing which tool to use for which job is the difference between elegant code and a messy workaround. The notes in this collection are your tool manual, explaining not just what each tool does but when and how to use it effectively.

Cross-References

Common Mistakes

Assuming TypeScript catches all type errors: TypeScript is structural, not nominal. Two types with the same shape are compatible even if they have different names. This can mask bugs where semantically different types are used interchangeably.

Not using TypeScript for server-side code: TypeScript isnt just for frontend. Node.js backends benefit enormously from type safety. API contracts, database queries, and configuration can all be type-checked.

Ignoring declaration files (.d.ts): When using JavaScript libraries without TypeScript types, install DefinitelyTyped types. Without types, the library is treated as any.