Options
All
  • Public
  • Public/Protected
  • All
Menu

Module union

Index

Functions Array

Array Functions

  • union<T>(...arrays: T[][]): T[]
  • union(...arrays: any[][]): any[]
  • Creates an array of unique values, in order, from all given arrays using SameValueZero for equality comparisons.

    since

    5.20.0

    see

    difference, unionBy, unionWith, without, xor, xorBy

    example
    union([2, 3], [1, 2])
    // => [2, 3, 1]

    Type Parameters

    • T

    Parameters

    • Rest ...arrays: T[][]

      The arrays to inspect.

    Returns T[]

    Returns the new array of combined values.

  • Parameters

    • Rest ...arrays: any[][]

    Returns any[]