Lodash – pull All method

  • Post author:
  • Post category:Lodash
  • Post comments:2 Comments
Lodash - pull all method

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

This Post Has 2 Comments

Leave a Reply