Skip to content

Files

Latest commit

author
Tristan McLeay
May 9, 2016
ec9de4f · May 9, 2016

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);