Object.values and/or Object.forEach ?

Axel Rauschmayer axel at rauschma.de
Sat Jun 8 21:52:35 PDT 2013


> Why refuse a convenient library method and force users to
> 1) let values = [];
> 2) for (v of values(o)) { values.push(v); }
> , if it can be just let values = Object.values(o);?


Note that you can do either of the following:

    let values = [...values(o)];
    let values = Array.from(values(o));

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130609/d204ee64/attachment-0001.html>


More information about the es-discuss mailing list