pull es-toolkit
Removes all specified values from an array.
Usage
pull(arr, valuesToRemove)
Use pull when you want to remove all occurrences of specific values from an array. This function modifies the original array directly and returns the modified array.
If you want to create a new array without modifying the original, use the difference function.
Parameters
arrT[]required
The array from which to remove values.
valuesToRemovereadonly unknown[]required
An array of values to remove from the array.
Returns
The original array with the specified values removed. The original array is modified and returned.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.