Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 261 Bytes

currying.md

File metadata and controls

18 lines (12 loc) · 261 Bytes

Currying

Just use a chain of fat arrow functions:

// A curried function
let add = (x: number) => (y: number) => x + y;

// Simple usage
add(123)(456);

// partially applied
let add123 = add(123);

// fully apply the function
add123(456);