Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 253 Bytes

currying.md

File metadata and controls

17 lines (12 loc) · 253 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);