On 7/21/2015 12:07 PM, Tom Schuster wrote:
Aside: Please also try avoid using Iterator().

What would be the alternative to Iterator() when I need to iterate and
easily assign both keys and values of an object to local variables?

See for example <https://bugzilla.mozilla.org/show_bug.cgi?id=980828>:

  this.boundEventHandlers = [
    for ([elementName, events] of Iterator(this.events))
    for ([eventName, handler] of Iterator(events))
    [elementName, eventName, handler.bind(this)]
  ];

There's more context on the bug for the specific example (the bug is
about supporting destructuring in comprehensions in the first place)
but my concern in general is that I've failed to find an alternative
to Iterator() that is as expressive.

Cheers,
Paolo
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to