Function uniqueSort

  • uniqueSort<T>(nodes: T[]): T[]
  • Sort an array of nodes based on their relative position in the document, removing any duplicate nodes. If the array contains nodes that do not belong to the same document, sort order is unspecified.

    Returns

    Collection of unique nodes, sorted in document order.

    Type Parameters

    • T extends AnyNode

    Parameters

    • nodes: T[]

      Array of DOM nodes.

    Returns T[]