Skip to content

eles.same(other)

eles.same — Collection > Comparison. Cytoscape.js signatures, parameters and return contract.

eles.same — Collection › Comparison

Preview · Collection › Comparison

Read in the complete API reference · All API members

// Whether both collections hold exactly the same elements, ignoring order
eles.same(other: Collection): boolean

Whether both collections hold exactly the same elements, ignoring order.

Parameters
NameDescription
other: Collection

the collection to compare against

Returns boolean

true when the element sets are equal

Example

const other = cy.getElementById('b');
console.log(cy.getElementById('a').same(other)); // false

Example graph and handle setup

Also spelled eles.equal, eles.equals.