// This collection's elements that are not in other
eles.difference(other: Collection): Collection<NodeData, EdgeData, Data>This collection's elements that are not in other.
| Name | Description |
|---|---|
other: Collection | the collection to subtract |
Returns
Collection<NodeData, EdgeData, Data>a new collection
Example
const other = cy.getElementById('b');console.log(cy.getElementById('a').difference(other).map(ele => ele.id())); // ["a"]Also spelled eles.not, eles.subtract, eles.unmerge, eles.relativeComplement.