# Generics

The Generics workshop is your guide to mastering one of TypeScript's most complex features - generics. If you've got an idea of a TypeScript library has amazing DX, it's likely got a _lot_ of generics sprinkled throughout. Generics drive some of TypeScript's most powerful features, but they're also one of its most complex features.

In this workshop, we'll run through dozens of exercises to help you get to grips with generics. We'll also compare and contrast them to function overloads.

## Intro to Generics

The best place to start is the start. We'll learn the syntax for assigning generics to functions and classes. We'll learn what's possible with the syntax, and build our very first runtime generic function.

## Passing Type Arguments

TypeScript can infer generics based on arguments passed to functions - but there's an alternative. You can manually pass types as type arguments to functions. We'll cover exactly why this is useful, _when_ it's useful, and what limitations this approach has.

## The Art of Generic Inference

Understanding generics in functions requires deep knowledge of the TypeScript compiler. You usually have multiple options when it comes to representing a generic in a function - and there's often not a right answer. We'll examine exercises which help illuminate these decisions.

## Advanced Generics

There's more to generics than inference. In this section we'll cover generics with conditional types, generic currying, and generics on interfaces. Each come with their own challenges.

## Function Overloads

Sometimes, you don't need a generic. Function overloads provide another method for inferring types from arguments passed to a function. In this section, we'll compare and contrast overloads with generics - and even discuss how they can be combined.
