Skip to content

eles.every(fn, thisArg?)

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

eles.every — Collection › Iteration and aggregation

Preview · Collection › Iteration and aggregation

Read in the complete API reference · All API members

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

Whether every element satisfies the predicate. Short-circuits, and is vacuously true for an empty collection.

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

( ele, i, eles) => boolean

thisArg: unknown?

optional receiver for the callback

Returns boolean

true when all elements match

Example

console.log(cy.nodes().every(ele => ele.isNode())); // true

Example graph and handle setup