What is difference between for and for each loop.

What is difference between for and for each loop.Please explain with a example.

Your Answer

The for loop is best for iterating over name-value pairs, and the forEach is loop best for iterating over values, for example arrays or objects. The for loop is best for name-value pairs. The for loop can be used to explore the possible properties and methods of an object. The forEach loop is best for iterating values.

Html

Didn't get the answer.
Contact people of Talent-Html directly by clicking here