#eles.union(other)
// The union of the two collections, deduped
eles.union<OtherData = Data>(other: Collection<NodeData, EdgeData, OtherData>): Collection<NodeData, EdgeData, Data | OtherData>The union of the two collections, deduped.
| Name | Description |
|---|---|
other: Collection<NodeData, EdgeData, OtherData> | the collection to add |
Collection<NodeData, EdgeData, Data | OtherData>a new collection holding both sets
Example
const other = cy.getElementById('b');console.log(cy.getElementById('a').union(other).map(ele => ele.id())); // ["a","b"]Also spelled eles.u, eles.or, eles.add, eles.merge.