Skip to content

Instantly share code, notes, and snippets.

@jasonkarns
Last active December 16, 2015 22:09
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 jasonkarns/5505502 to your computer and use it in GitHub Desktop.
Save jasonkarns/5505502 to your computer and use it in GitHub Desktop.
Instead of partially applying parameters to a function, partially apply properties on a plain old javascript object.
_.partialObject = function(func, partial_object) {
return function(object) {
return func.call(this, _.extend({}, partial_object, object));
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment