pullAll

array

This method is like pull except that it accepts an array of values to remove.

Signature

pullAll<T>(array: T[], values: T[]): T[]

Parameters

NameTypeDescription
arrayT[]The array to modify
valuesT[]The values to remove

Returns

T[] - Returns array

Examples

Remove array of values

import { pullAll } from 'dashlite'

const array = ['a', 'b', 'c', 'a', 'b', 'c']
pullAll(array, ['a', 'c'])
console.log(array)

Output:

['b', 'b']

Notes

  • This method mutates array

Available since version 1.0.0