In JavaScript, the ______ method is used to iterate over all enumerable properties of an object.

  • for loop
  • forEach
  • while loop
  • iterate
The forEach method is used in JavaScript to iterate over all enumerable properties of an object. It is commonly used with arrays to perform an action on each item. The for loop and while loop are general looping constructs and not specific to object iteration. iterate is not a standard method.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *