pull
arrayRemoves all given values from array using SameValueZero for equality comparisons.
Signature
pull<T>(array: T[], ...values: T[]): T[]Parameters
| Name | Type | Description |
|---|---|---|
array | T[] | The array to modify |
values | T[] | The values to remove |
Returns
T[] - Returns array
Examples
Remove values
import { pull } from 'dashlite'
const array = ['a', 'b', 'c', 'a', 'b', 'c']
pull(array, 'a', 'c')
console.log(array)Output:
['b', 'b']Notes
- •This method mutates array
Available since version 1.0.0