- Lodash Tutorial
- Lodash - Home
- Lodash - Overview
- Lodash - Environment Setup
- Lodash - Array
- Lodash - Collection
- Lodash - Date
- Lodash - Function
- Lodash - Lang
- Lodash - Math
- Lodash - Number
- Lodash - Object
- Lodash - Seq
- Lodash - String
- Lodash - Util
- Lodash - Properties
- Lodash - Methods
- Lodash Useful Resources
- Lodash - Quick Guide
- Lodash - Useful Resources
- Lodash - Discussion
Lodash - partialRight method
Syntax
_.partialRight(func, [partials])
This method is like _.partial except that partially applied arguments are appended to the arguments it receives.
Arguments
func (Function) − The function to partially apply arguments to.
[partials] (...*) − The arguments to be partially applied.
Output
(Function) − Returns the new partially applied function.
Example
var _ = require('lodash'); var divide = function(a, b) { return b / a}; var divideBy5 = _.partialRight(divide, 5); var result = divideBy5(10); console.log(result); var divisionOf10 = _.partialRight(divide, _, 10) result = divisionOf10(5) console.log(result);
Save the above program in tester.js. Run the following command to execute this program.
Command
\>node tester.js
Output
0.5 2
lodash_function.htm
Advertisements