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
m...@isiahmeadows.com

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 <p.jasz...@gmail.com> 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" <sebast...@malton.name> 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
>> es-discuss@mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to