neo icon indicating copy to clipboard operation
neo copied to clipboard

Object.hasOwn()

Open tobiu opened this issue 3 years ago • 1 comments

I kind of missed this one :)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn

we can now replace all occurrences of Object.hasOwnProperty() with hasOwn().

MDN recommends to do so, the bundle sizes get a bit smaller and the browser and nodejs support is decent.

tobiu avatar Jun 07 '22 09:06 tobiu

well, actually it is not true for the bundle size, since we can call hasOwnProperty() directly on objects, while hasOwn() has to get called on Object. still, we should do it.

tobiu avatar Jun 07 '22 09:06 tobiu