Skip to content

eles.some(fn, thisArg?)

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

eles.some — Collection › Iteration and aggregation

Preview · Collection › Iteration and aggregation

Read in the complete API reference · All API members

// Whether any element satisfies the predicate
eles.some(fn: EleFilterFn<NodeData, EdgeData, Data>, thisArg?: unknown): boolean

Whether any element satisfies the predicate. Short-circuits.

Parameters
NameDescription
fn: EleFilterFn<NodeData, EdgeData, Data>

( ele, i, eles) => boolean

thisArg: unknown?

optional receiver for the callback

Returns boolean

true when at least one element matches

Example

console.log(eles.some(ele => ele.isEdge())); // true

Example graph and handle setup