Options
All
  • Public
  • Public/Protected
  • All
Menu

Module pull

Index

Functions Array

Array Functions

  • pull<T>(array: T[], ...values: T[]): T[]
  • Removes all given values from array using SameValueZero for equality comparisons.

    Note: Unlike without, this method mutates array. Use remove to remove elements from an array by predicate.

    since

    5.11.0

    see

    pullAll, pullAllBy, pullAllWith, pullAt, remove, reject

    example
    const array = ['a', 'b', 'c', 'a', 'b', 'c']

    pull(array, 'a', 'c')
    console.log(array)
    // => ['b', 'b']

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to modify.

    • Rest ...values: T[]

      The values to remove.

    Returns T[]

    Returns array.