Q. The enumeration order becomes implementation dependent and non-interoperable if:
β
Correct Answer: (C)
If the object inherits enumerable properties
Explanation:
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.