← You use `obj.hasOwnProperty(key)` to check property ownership. It can silently fail. `Object.hasOwn()` is the safe replacement.Quiz

Object.hasOwn() — safe property ownership checks

Object.hasOwn() is the ES2022 replacement for obj.hasOwnProperty(key). These questions check the two failure modes of the classic pattern, what Object.hasOwn() does differently, when for...in needs it, how it behaves in TypeScript, and what browser versions ship it.

questions8
pass mark70%
resultsat the end

No account needed. Answer all 8 questions, then see your score with every answer explained and a reference to the spec or MDN — pass and you can claim a certificate.