// The elements present in both collections
eles.intersection(other: Collection): Collection<NodeData, EdgeData, Data>The elements present in both collections.
| Name | Description |
|---|---|
other: Collection | the collection to intersect with |
Returns
Collection<NodeData, EdgeData, Data>a new collection
Example
const other = cy.getElementById('b');console.log(cy.getElementById('a').intersection(other).map(ele => ele.id())); // []Also spelled eles.intersect, eles.and.