Skip to content

Instantly share code, notes, and snippets.

@thephilip
Last active May 3, 2017 17:10
Show Gist options
  • Save thephilip/3db73bc7bd29592329d4c3a9c7e7bd6d to your computer and use it in GitHub Desktop.
Save thephilip/3db73bc7bd29592329d4c3a9c7e7bd6d to your computer and use it in GitHub Desktop.
// using bind()
const partialBind = (fn, ...args) => {
return fn.bind(null, ...args);
};
// with a closure
const partial = (fn, ...args) => {
return (...moreArgs) => {
return fn(...args, ...moreArgs)
};
};
// curried
const partialCurried = fn => ...args => {
// see: partialCurried.js
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment