Creates a partial function where the arguments in any position can be set. Also allows for setting the value of this.

This function is valid in v2.0.0 to v2.24.2. This function has been downloaded 40 times.


{Function} fn
Function to return a partial version of.
{Object} objArgPresets
Object whose properties will be used to preset the arguments within the partial function. Each property name that is a positive integer will be used to fill in arguments from the left while property names that are negative integers (including -0) will be used to fill in arguments from the right. If a property is named this it will be used to specify the this context object of the partial function.


A partial version of fn with the arguments specified in objArgPresets already set.

Required Functions

This function directly requires the following functions which are included automatically:

  • forIn()
    Runs through all of the properties of an object, executing a function for each property found.
  • slice()
    Slice does not modify the original array, but instead returns a shallow copy of elements from the original array.