---
title: 'Why Solving Type Challenges Makes You a Better Developer'
description: 'Sharpening your mental model of TypeScript through deliberate practice.'
subtitle: 'Conditional types, infer, template literals, and tuple manipulation.'
date: '2024-10-05'
lang: 'en'
---

Many developers view TypeScript merely as a linter with types. But beneath the surface lies a Turing-complete type system.

## Unpacking `infer` and Recursion

Consider flattening an array type:

```typescript
type Flatten<T> = T extends Array<infer Item> ? Flatten<Item> : T

type Test = Flatten<[1, [2, [3, [4]]]]> // number
```

Working through type puzzles forces you to understand variance, distribution, and assignability at a fundamental level.
