bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/TypeScript

TypeScript

TypeScript Core

Understand TypeScript syntax, types, narrowing, interfaces, generics, and practical usage patterns.

Lesson 1

TypeScript Tutorial

TypeScript Tutorial

2 min
Read lesson →
Lesson 2

TypeScript Introduction

TypeScript is JavaScript with added syntax for types. What is TypeScript? TypeScript is a syntactic superset of JavaScript which adds static typing. This basically means that TypeScript adds syntax o…

2 min
Read lesson →
Lesson 3

TypeScript Getting Started

TypeScript Compiler TypeScript is transpiled into JavaScript using a compiler. TypeScript being converted into JavaScript means it runs anywhere that JavaScript runs! Installing the Compiler TypeScri…

3 min
Read lesson →
Lesson 4

TypeScript Simple Types

TypeScript enhances JavaScript by adding static types. JavaScript and TypeScript Primitives The most basic types in TypeScript are called primitives. These types form the building blocks of more comp…

2 min
Read lesson →
Lesson 5

TypeScript Explicit Types and Inference

Type Annotations and Inference TypeScript offers two ways to work with types: Explicit Typing : You explicitly declare the type of a variable Type Inference : TypeScript automatically determines the…

4 min
Read lesson →
Lesson 6visual

TypeScript Special Types

TypeScript includes several special types that have specific behaviors in the type system. These types are used in various scenarios to handle cases where the type might not be known in advance or wh…

5 min
Read lesson →
Lesson 7visual

TypeScript Tuples

Typed Arrays A tuple is a typed array with a pre-defined length and types for each index. Tuples are great because they allow each element in the array to be a known type of value. To define a tuple,…

2 min
Read lesson →
Lesson 8

TypeScript Enums

An enum is a special "class" that represents a group of constants (unchangeable variables). Enums come in two flavors string and numeric. Let's start with numeric. Numeric Enums - Default By default,…

2 min
Read lesson →
Lesson 9

TypeScript Type Aliases and Interfaces

TypeScript allows types to be defined separately from the variables that use them. Aliases and Interfaces allows types to be easily shared between different variables/objects. Type Aliases Type Alias…

2 min
Read lesson →
Lesson 10

TypeScript Functions

TypeScript has a specific syntax for typing function parameters and return values. Read more about functions here. Return Type The type of the value returned by the function can be explicitly defined…

2 min
Read lesson →
Lesson 11

TypeScript Casting

There are times when working with types where it's necessary to override the type of a variable, such as when incorrect types are provided by a library. Casting is the process of overriding a type. C…

2 min
Read lesson →
Lesson 12

TypeScript Classes

TypeScript adds types and visibility modifiers to JavaScript classes. Learn more about JavaScript classes here. Members: Types The members of a class (properties & methods) are typed using type annot…

4 min
Read lesson →
Lesson 13

TypeScript Basic Generics

Generics allow creating 'type variables' which can be used to create classes, functions & type aliases that don't need to explicitly define the types that they use. Generics make it easier to write r…

2 min
Read lesson →
Lesson 14

TypeScript Utility Types

TypeScript comes with a large number of types that can help with some common type manipulation, usually referred to as utility types. This chapter covers the most popular utility types. Partial Parti…

2 min
Read lesson →
Lesson 15

TypeScript Keyof

keyof is a keyword in TypeScript which is used to extract the key type from an object type. keyof with explicit keys When used on an object type with explicit keys, keyof creates a union type with th…

2 min
Read lesson →
Lesson 16

TypeScript Null & Undefined

TypeScript has a powerful system to deal with null or undefined values. By default null and undefined handling is disabled, and can be enabled by setting strictNullChecks to true. The rest of this pa…

2 min
Read lesson →
Lesson 17

TypeScript Definitely Typed

NPM packages in the broad JavaScript ecosystem don't always have types available. Sometimes the projects are no longer maintained, and other times they aren't interested in, agree with, or have time…

2 min
Read lesson →
Lesson 18

TypeScript 5.x Updates

TypeScript is actively maintained and updated by Microsoft. In version 5.x a lot of utility and quality of life updates were made. This chapter covers the most popular updates to allow stricter and m…

2 min
Read lesson →
Lesson 19visual

TypeScript Configuration

Introduction The tsconfig.json file is the heart of every TypeScript project. It tells the TypeScript compiler how to process your code, which files to include, and which features to enable or disabl…

2 min
Read lesson →
Lesson 20visual

TypeScript with Node.js

TypeScript with Node.js

7 min
Read lesson →
Lesson 21visual

TypeScript Tooling

TypeScript Development Ecosystem TypeScript's tooling ecosystem is one of its greatest strengths, providing developers with powerful tools for every stage of development: Code Quality ESLint with Typ…

6 min
Read lesson →
Lesson 22visual

TypeScript Advanced Types

Advanced TypeScript Types TypeScript's advanced type system allows you to model complex type relationships with precision. These features are particularly useful for building robust, maintainable app…

8 min
Read lesson →
Lesson 23

TypeScript Type Guards

Understanding Type Guards in TypeScript TypeScript Type Guards are powerful constructs that allow you to narrow down the type of a variable within a specific scope. They help TypeScript understand an…

5 min
Read lesson →
Lesson 24

TypeScript Conditional Types

Understanding Conditional Types in TypeScript Conditional types in TypeScript enable you to create types that depend on other types, similar to how if-else statements work in JavaScript. They're a po…

5 min
Read lesson →
Lesson 25

TypeScript Mapped Types

Mapped types in TypeScript allow you to create new types by transforming properties of existing types. Mapped types = transform every property of a type Common ones: Partial, Readonly, Pick, Omit, Re…

5 min
Read lesson →
Lesson 26

TypeScript Literal Types

Understanding Literal Types in TypeScript Literal types in TypeScript allow you to specify exact values that variables can hold, providing more precision than broader types like string or number. The…

7 min
Read lesson →
Lesson 27visual

TypeScript Namespaces

Understanding TypeScript Namespaces TypeScript namespaces (previously known as "internal modules") provide a powerful way to organize code and prevent naming conflicts by creating a container for rel…

8 min
Read lesson →
Lesson 28visual

TypeScript Index Signatures

Understanding Index Signatures in TypeScript Index signatures in TypeScript provide a powerful way to define types for objects with dynamic property names while maintaining type safety. They allow yo…

5 min
Read lesson →
Lesson 29visual

TypeScript Declaration Merging

Understanding Declaration Merging Declaration merging is a powerful TypeScript feature that allows you to combine multiple declarations with the same name into a single definition. This enables you t…

5 min
Read lesson →
Lesson 30visual

TypeScript Async Programming

Master asynchronous programming in TypeScript with Promises, async/await, error handling, and advanced patterns. Learn best practices for writing robust async code.

10 min
Read lesson →
Lesson 31

TypeScript Decorators

Decorators are a powerful TypeScript feature that allow you to add metadata and modify classes and their members at design time. They are widely used in frameworks like Angular and NestJS for depende…

14 min
Read lesson →
Lesson 32visual

TypeScript in JavaScript Projects (JSDoc)

TypeScript in JavaScript Projects (JSDoc)

6 min
Read lesson →
Lesson 33visual

TypeScript Migration Guide

Migrating from JavaScript to TypeScript can significantly improve your codebase's maintainability and developer experience. This guide will walk you through the process step by step. Preparation Phas…

5 min
Read lesson →
Lesson 34visual

TypeScript Error Handling

Robust error handling is crucial for building reliable TypeScript applications. This guide covers everything from basic try/catch to advanced error handling patterns. Basic Error Handling Try/Catch B…

6 min
Read lesson →
Lesson 35visual

TypeScript Best Practices

This guide covers essential TypeScript best practices to help you write clean, maintainable, and type-safe code. Following these practices will improve code quality and developer experience. Project…

12 min
Read lesson →