Skip to content

ele.isLoop()

eles.isLoop — Collection > Metadata and identity. Cytoscape.js signatures, parameters and return contract.

eles.isLoop — Collection › Metadata and identity

Preview · Collection › Metadata and identity

Read in the complete API reference · All API members

// Whether the first element is a self-loop — an edge whose source and target are the same node
ele.isLoop(): boolean

Whether the first element is a self-loop — an edge whose source and target are the same node.

Returns boolean

true for a loop edge; false for nodes and removed elements

Example

console.log(eles.isLoop()); // false

Example graph and handle setup