Range.unhead
Returns the first element of the range and the remaining range.
Arguments
None
Return values
value
or { key: Key; value: Value; }
structure of the first element, depending on the range type.The remaining
range
.
Complexity
Constant, O(log(size)) for RedBlackTree.
Example
Output:
1,2,3,-1,-2,-3,10,20,30,-10,-20,-30
{ key: 1; value: "ONE"; },{ key: 2; value: "TWO"; }