ReverseIterable interface

# Lee Byron (9 years ago)

I’m working on a spec proposal that I’d like to present as a strawman (stage 0) for reverse iteration.

leebyron/ecmascript-reverse-iterator

The TL;DR is adding a new well known symbol Symbol.reverseIterator and adding methods to the collection prototypes that can be efficiently iterated in reverse. It also suggests adding reverse() to %IteratorPrototype% as an API sugar.

I’m looking for broad feedback as well as stakeholders if this functionality is important to you.

# Kevin Smith (9 years ago)

Cool, and very thorough! I'll repost if I can think of any questions.

# Tab Atkins Jr. (9 years ago)

I like it! Formalizing the idea of a reversible iterator, so we don't always have to collect into a list and reverse that, is a great idea.