Takaro - v0.4.11
    Preparing search index...

    Function unionWith

    • This method is like _.union except that it accepts comparator which is invoked to compare elements of arrays. The comparator is invoked with two arguments: (arrVal, othVal).

      Type Parameters

      • T

      Parameters

      • Optionalarrays: List<T> | null

        The arrays to inspect.

      • Optionalcomparator: Comparator<T>

        The comparator invoked per element.

      Returns T[]

      Returns the new array of combined values.

      var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
      var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];

      _.unionWith(objects, others, _.isEqual);
      // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
    • Type Parameters

      • T

      Parameters

      • arrays: List<T> | null | undefined
      • arrays2: List<T> | null | undefined
      • Optionalcomparator: Comparator<T>

      Returns T[]

      _.unionWith

    • Type Parameters

      • T

      Parameters

      • arrays: List<T> | null | undefined
      • arrays2: List<T> | null | undefined
      • arrays3: List<T> | null | undefined
      • ...comparator: (List<T> | Comparator<T> | null | undefined)[]

      Returns T[]

      _.unionWith