Syntax Lodash pull All method
_.pullAll(array, values)
The Lodash pull All method gets all but the last element of the array.
Arguments
- array (Array) − The array to modify.
- values (Array) − The values to remove.
Output
- (Array) − Returns array.
Example
var _ = require('lodash'); var list = [1, 2, 3, 2, 5, 6, 2]; _.pullAll(list,[2,5]) console.log(list);
Save the above program in tester.js. Run the following command to execute this program.
Command
\>node tester.js
Output
[ 1, 3, 6 ]
Next Topic – Click Here
Pingback: Lodash - pull method - Adglob Infosystem Pvt Ltd
Pingback: Lodash - Array - Adglob Infosystem Pvt Ltd