What is the purpose of `Object.defineProperty()` and when must you use it instead of direct assignment?

JavaScript Medium
Select the correct answer: Single Choice

Key points

  • `Object.defineProperty()` sets property descriptor attributes
  • Required for non-enumerable properties, non-writable constants, and non-configurable properties
  • Enables defining getter/setter accessor properties
  • Direct assignment doesn't offer these capabilities

Ready to go further?