MCQ Practice Single Best Answer Topic: Javascript loops MCQ

Q What happens if the for/in loop body deletes a property that has not yet been enumerated?

Question ID
#5065
Subchapter
Javascript loops MCQ
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A The property will be stored in a cache
  • B The loop will not run
  • C That property will not be enumerated
  • D The property will be enumerated
Correct Answer: C

Explanation

If the body of a for/in loop removes a property that has not yet been enumerated, that property will not be included in the loop.
Additionally, if the body of the loop adds new properties to the object, those properties will typically not be enumerated.

Share This Question

Share this MCQ with your friends or study group.