A

Admin • 833.24K Points
Coach

Q. The enumeration order becomes implementation dependent and non-interoperable if:

  • (A) The delete keyword is never used
  • (B) Object.defineProperty() is not used
  • (C) If the object inherits enumerable properties
  • (D) The object does not have the properties present in the integer array indices
  • Correct Answer - Option(C)
  • Views: 34
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin

In JavaScript, the enumeration order of object properties is well-defined for own properties but can become implementation-dependent and non-interoperable when inherited properties (i.e., properties from the prototype chain) are enumerable.

  • If an object inherits enumerable properties, their enumeration order is not guaranteed to be consistent across different JavaScript engines.
  • Different JavaScript engines (like V8, SpiderMonkey, and Chakra) may handle the order of inherited properties differently, leading to inconsistencies in enumeration order.

Thus, option (C) is correct.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.