The _.rearg() method in lodash is used to create a function that calls func parameter with the arguments that are organized according to the stated indexes. Where, the argument valued at the first index is sent as the first argument, the argument valued at the second index is sent as the second argument, and so on.
Parameters: This method accepts two parameters as mentioned above and described below:
- func: It is the function which is used to reorganize the arguments for.
- indexes: It is the indexes of organized argument.
Return Value: This method returns the new function.
[ 'x', 'y', 'z' ]