← Back to release summary

Object.hasOwn

Category
JavaScript
Type
Chromium catches up
Status
Enabled by default (Chrome 93)
Intent stage
Shipped

Summary

Object.hasOwn provides an easier-to-use, static method version of Object.prototype.hasOwnProperty. For example, Object.hasOwn({ prop:42 }, 'prop') returns true.

Standards & signals

Explainers: https://v8.dev/features/object-has-own https://github.com/tc39/proposal-accessible-object-hasownproperty

View on chromestatus.com