Home » JavaScript » JavaScript While Loop » Question

JavaScript While Loop

  1. What will happen if the body of a for/in loop deletes a property that has not yet been enumerated?
    1. The property will be enumerated
    2. The loop will not run
    3. The property will be stored in a cache
    4. That property will not be enumerated
    5. None of these
Correct Option: A

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.



Your comments will be displayed only after manual approval.