pull

array

Removes all given values from array using SameValueZero for equality comparisons.

Signature

pull<T>(array: T[], ...values: T[]): T[]

Parameters

NameTypeDescription
arrayT[]The array to modify
valuesT[]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