Skip to content

eles.eq(i)

eles.eq — Collection > Iteration and aggregation. Cytoscape.js signatures, parameters and return contract.

eles.eq — Collection › Iteration and aggregation

Preview · Collection › Iteration and aggregation

Read in the complete API reference · All API members

// The element at an index, as a length-1 collection
eles.eq(i: number): Collection<NodeData, EdgeData, Data>

The element at an index, as a length-1 collection.

Parameters
NameDescription
i: number

the index

Returns Collection<NodeData, EdgeData, Data>

that element, or an empty collection when out of range

Example

console.log(eles.eq(0).id()); // 'a'

Example graph and handle setup