Skip to content

Instantly share code, notes, and snippets.

@larryyangsen
Last active May 18, 2018 12:27
Show Gist options
  • Save larryyangsen/4dfc7759d5b2a0e7ee13686a5d7c993c to your computer and use it in GitHub Desktop.
Save larryyangsen/4dfc7759d5b2a0e7ee13686a5d7c993c to your computer and use it in GitHub Desktop.
const partial = (fn, ...args) => fn.bind(null, ...args);
const add3 = (a, b, c) => a + b + c;
const inc = partial(add3, 1, 2);
const result = inc(3);
console.log(result) //6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment