Array extras functionality for iterators
waldron.rick at gmail.com
Tue Feb 28 09:21:57 PST 2012
On Tue, Feb 28, 2012 at 12:06 PM, Yehuda Katz <wycats at gmail.com> wrote:
> Catching up on this discussion.
> Personally, I'd like to see us come to quick consensus on `forEach` for
> collections, because without something like `forEach`, it's impossible to
> implement useful versions of these collections in user-space in browsers
> that do not implement for-of.
> Indeed, the current browsers that implement Map and Set do not implement
> for-of, which means that even though browsers implement the collections
> (and Mozilla has for a bit now), they are not very useful because they
> cannot be iterated over. Had `forEach` been part of the initial spec, I
> would be using them today.
I've had the same experience that Yehuda describes - it's almost comical
that Chrome blog published an announcement for the support of Map and Set,
> var s = new Set()
...They are useless.
> One last thing: `forEach` on `Map` should probably pass the key and value
> to the function.
+1 to Map.prototype.forEach receiving key and value as arguments
> Yehuda Katz
> (ph) 718.877.1325
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss