On Wed, Jul 18, 2018 at 5:31 PM, Michael Luder-Rosefield
<[email protected]> wrote:
> At the moment, we have:
>
> every
> filter
> find
> findIndex
> forEach
> indexOf / lastIndexOf
> map
> reduce / reduceRight
> some
>
> which is not very consistent at all. Perhaps we could add an `iterOrder`
> method that changes the way the array is iterated through?
Stupid question, but why are some of these methods implemented on
String, Array, TypedArray, Map and Set, while all of them are
Iteratable?
If we were to add all these methods on Iteratable, then one could add
a `reverse` generator property on Iteratable.
Iteratable.prototype.reverse = function* reverse() { … };
foo.reverse().forEach( e => console.log(e) )
Though, this implies that all these objects implement the Iteratable
prototype, and I am not sure what impact this might have on the Web.
--
Nicolas B. Pierron
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss