// A sub-range of the collection, with Array#slice semantics (negative indices count from the end)
eles.slice(start?: number, end?: number): Collection<NodeData, EdgeData, Data>A sub-range of the collection, with Array#slice semantics (negative indices count from the end).
| Name | Description |
|---|---|
start: number?Default: 0 | first index, inclusive |
end: number?Default: this.length | last index, exclusive |
Returns
Collection<NodeData, EdgeData, Data>the sub-range as a new collection
Example
console.log(eles.slice().map(ele => ele.id())); // ["a","b","c","ab","bc"]