MCQs>IT & Programming>JavaScript>String values have a 'length' property. Why is this property not included in a for-in loop over a string object? var prop, str; str = 'example'; /* str.length === 7 */ for ( prop in str) {}
JavaScript MCQs
String values have a "length" property. Why is this property not included in a for-in loop over a string object? var prop, str; str = 'example'; /* str.length === 7 */ for ( prop in str) {}
Answer
Correct Answer: Because the "length" property has internal [[Enumerable]] set to false.
Explanation:
Note: This Question is unanswered, help us to find answer for this one