ecmascript-reverse-iterable
ecmascript-reverse-iterable copied to clipboard
Add comparison to other languages and standard libraries
I think a valuable part of a proposal like this is to compare with how other languages and standard libraries have solved this issue. I'd be curious to see C# Enumerables, Java streams, Ruby, and Python at least.
Excellent feedback. I'll do some research.
python has the reversed
function which returns a reverse_iterator
. The reversed
function can either take an object that has a __reversed__
method (analog to Symbol.reverseIterator
) or an object that meets the "sequence protocol", e.g. in JavaScript it would have a numeric length property.