Elance Exams Answers PDF file

-- PDF FILE --
Download PDF file of elance Zoho Creator Exam Answers

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) {}

Because the "length" property isn't a real property (defined and set through get/set accessors). Properties with accessors are not included in for-in loops.
Because the "length" property is only in the String prototype, it is not an own property of string objects, and as such is not included in a for-in loop.
Because the "length" property has internal [[Enumerable]] set to false.
  • Follows us our servcies
  • Facebook icon
  • Linkedin icon
  • twitter icon
  • rss icon
  • social icon