// Map each element through fn into a plain array
eles.map<T>(fn: ( ele: Collection<NodeData, EdgeData, Data>, i: number, eles: Collection<NodeData, EdgeData, Data>, ) => T, thisArg?: unknown): T[]Map each element through fn into a plain array.
| Name | Description |
|---|---|
fn: ( ele: Collection<NodeData, EdgeData, Data>, i: number, eles: Collection<NodeData, EdgeData, Data>, ) => T |
|
thisArg: unknown? | optional receiver for the callback |
Returns
T[]an array of the results
Example
console.log(cy.nodes().map(node => node.id())); // ['a', 'b', 'c']