This would break a Web, a I have seen code that relies on
Object.hasOwnProperty === Object.prototype.hasOwnProperty

Anyway, it would be handy to have such function as `Reflect.hasOwn` or
something like that.
On 26 May 2016 10:38 p.m., "doodad-js Admin" <[email protected]> wrote:

> >> Both the concern of `someObj.hasOwnProperty(somePropertyName)`
> attempting to call the `hasOwnProperty` property of `someObj` rather than
> walking the prototype chain to get `Object.prototype.hasOwnProperty`, and
> the >> concern of `someObj` having a null prototype (or otherwise not
> having `Object.prototype.hasOwnProperty` on its prototype chain) can be
> avoided with the `{}.hasOwnProperty.call(someObj, somePropertyName)`
> pattern.
>
> Hi,
>
> Yeah, sure. But it could be cleaner to do:
>
> ```js
> Object.hasOwnProperty(myObj, someName)
> ```
>
> instead of
>
> ```js
> {}.hasOwnProperty.call(myObj, someName)
> ```
>
>
> _______________________________________________
> 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

Reply via email to