Options
All
  • Public
  • Public/Protected
  • All
Menu

Module pullAt

Index

References

Functions Array

References

Renames and re-exports __type

Array Functions

  • pullAt<T>(array: T[], ...indexes: (string | number)[]): T[]
  • Removes elements from array corresponding to indexes and returns an array of removed elements.

    Note: Unlike at, this method mutates array.

    since

    5.11.0

    see

    pull, pullAll, pullAllBy, pullAllWith, remove, reject

    example
    const array = ['a', 'b', 'c', 'd']
    const pulled = pullAt(array, [1, 3])

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

    console.log(pulled)
    // => ['b', 'd']

    Type parameters

    • T = any

    Parameters

    • array: T[]

      The array to modify.

    • Rest ...indexes: (string | number)[]

      The indexes of elements to remove.

    Returns T[]

    Returns the new array of removed elements.