forked from cytoscape/cytoscape.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Collection slice
maxkfranz edited this page Mar 8, 2012
·
3 revisions
Get a subset of the collection between two indices.
Gets all elements including and after the specified index
start : The index of the first element to include in the returned collection
Gets elements between two specified indices
start : The index of the first element to include in the returned collection
end : The index of the end of the slice; the element at this index is not included
This function is useful for getting a "subarray" of the collection.
var allButFirstNode = cy.nodes().slice(1);
var secondAndThirdNode = cy.nodes().slice(1, 3);