reverse
优质
小牛编辑
144浏览
2023-12-01
Creates a new sequence with the same elements as this one, but to be iterated in the opposite order.
Note that in some (but not all) cases, the only way to create such a sequence may require iterating the entire underlying source when each
is called.
Signature
Sequence.reverse = function() { /*...*/ }
Sequence.reverse = function reverse() { return new ReversedSequence(this); }
Name | Type(s) | Description |
---|---|---|
returns | Sequence | The new sequence. |
Examples
Lazy([1, 2, 3]).reverse() // sequence: [3, 2, 1] Lazy([]).reverse() // sequence: []