Skip to content

Instantly share code, notes, and snippets.

@EdwinGuzman
Last active May 22, 2018 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EdwinGuzman/5f63be3a1e4502fb5faca5374f4944b3 to your computer and use it in GitHub Desktop.
Save EdwinGuzman/5f63be3a1e4502fb5faca5374f4944b3 to your computer and use it in GitHub Desktop.
const makeCurry = (fn) => {
const slice = [].slice;
return function curriedFn() {
let args = slice.call(arguments);
if (args.length < fn.length) {
return () => {
return curriedFn.apply(null, args.concat(slice.call(arguments)));
};
}
return fn.apply(null, args);
};
};
const volume = (length, width, height) => {
return length * width * height;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment