Vidyalelo
JavaScript · Q45

Basic And Variables

Programming · JavaScript · question 45

Q45

What will happen if the body of a for/in loop deletes a property that has not yet been enumerated?

A.
The property will be stored in a cache
B.
The loop will not run
C.
That property will not be enumerated
Answer
D.
All of the mentioned

Answer: Option C

Solution

Answer: Option C
Solution:
If the body of a for/in loop deletes a property that has not yet been enumerated, that property will not be enumerated. If the body of the loop defines new properties on the object, those properties will generally not be enumerated.