On Thu, Oct 25, 2012 at 6:24 AM, Axel Rauschmayer <a...@rauschma.de> wrote: > Sorry, slightly off-topic: Does Firefox already have @iter.items (etc.)? Or > is there something similar one could use to iterate over [key, value] pairs > for objects, via for-of?
Unfortunately Iterator does do that, but I tend to think you'd be better off using Object.keys. Of course you can also write your own: function items(obj) { return [[k, obj[k]] for (k of Object.keys(obj))]; } -j _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss