pullAllBy
arrayThis method is like pullAll except that it accepts iteratee which is invoked for each element of array and values to generate the criterion by which they're compared.
Signature
pullAllBy<T, U>(array: T[], values: T[], iteratee: (value: T) => U): T[]Parameters
| Name | Type | Description |
|---|---|---|
array | T[] | The array to modify |
values | T[] | The values to remove |
iteratee | (value: T) => U | The iteratee invoked per element |
Returns
T[] - Returns array
Examples
With iteratee
import { pullAllBy } from 'dashlite'
const array = [{ x: 1 }, { x: 2 }, { x: 3 }, { x: 1 }]
pullAllBy(array, [{ x: 1 }, { x: 3 }], (o) => o.x)
console.log(array)Output:
[{ x: 2 }]Notes
- •This method mutates array
Available since version 1.0.0