And I find it kind of absurd that engines don't yet optimize away the intermediate array allocation (even though it's literally almost equal to `for ... in` in performance). -----
Isiah Meadows [email protected] Looking for web consulting? Or a new website? Send me an email and we can get started. www.isiahmeadows.com On Mon, Feb 19, 2018 at 1:57 PM, Peter Jaszkowiak <[email protected]> wrote: > You could use Object.keys, Object.entries, or Object.values on the right > side of `of` instead. > > On Feb 19, 2018 11:50, "Sebastian Malton" <[email protected]> wrote: >> >> I would like to propose that the following be valid since it is a very >> common use case. >> >> ``` >> for (const field has in object) { >> .... >> } >> ``` >> >> Would be equivalent to: >> >> ``` >> for (const field in object) { >> if (!object.hasOwnPropety(field)) { >> continue; >> } >> .... >> } >> ``` >> >> Sebastian Malton >> >> >> _______________________________________________ >> es-discuss mailing list >> [email protected] >> https://mail.mozilla.org/listinfo/es-discuss >> > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

