The Lodash _.flip2() method returns a function that works identically to the given function but accepts the first two arguments in reverse order. The order of all rest arguments remains the same.
_.flip2( function );
Parameters: This method accepts a single parameter as mentioned above and defined below:
- function: This method takes a function that takes some arguments.
Return Value: This method returns a function.
Note: To execute the below examples, you have to install the lodash-contrib library by using this command prompt and execute the following command.
npm install lodash-contrib
a = 2, b = 1, c = 3
GeeksforGeeks : Computer Science Portal for Geeks