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

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it