Syntax Of Lodash flip method
_.flip(func)
The Lodash flip method creates a function that invokes func with arguments reversed.
Arguments
- func (Function) − The function to flip arguments for.
Output
- (Function) − Returns the new flipped function.
Example
var _ = require('lodash'); var flipped = _.flip(function() { return _.toArray(arguments); }); console.log(flipped(1, 2, 3, 4));
Save the above program in tester.js. Run the following command to execute this program.
Command
\>node tester.js
Output
[ 4, 3, 2, 1 ]
Next Topic – Click Here
Pingback: Lodash - delay method - Adglob Infosystem Pvt Ltd