0Pricing
TypeScript Academy · Lesson

Currying and Partial Application

Transform multi-argument functions into curried forms.

What Is Currying?

Currying transforms a function of many arguments into a chain of single-argument functions. Instead of f(a, b) you call f(a)(b).

The Classic Example

Here add takes one number and returns a function waiting for the next. TypeScript infers the nested function types automatically.

const add = (a: number) => (b: number) => a + b;
console.log(add(2)(3)); // 5

All lessons in this course

  1. Pure Functions and Immutability
  2. Currying and Partial Application
  3. Function Composition with Types
  4. Typed pipe and flow Utilities
← Back to TypeScript Academy