>
>
> * As far as I can tell, `hasOwnProperty` is mainly used to implement maps
> via objects. `Map` will eliminate this use case.
>

To a certain extent yes, but not completely.  Objects-as-maps will still be
used quite frequently as object literals passed into functions (as an
options object, for example).

I think that there is still a need here.  Since we are really interested in
*keys*, what about this:

    Object.hasKey(obj, someKey);

which would be a more ergonomic and efficient way of saying:

    Object.keys(obj).some(key => key === someKey)

?
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to