Jump to content

For....In Explaining


shreyaskudav

Recommended Posts

for-loops have been central to computing for a long time. They let you apply the same task to many pieces of information without writing a lot of extra code your don't need. But they originally could be used only on arrays that are numerically indexed.Modern objects (true objects or associative arrays) are NOT numerically indexed. Object indexes are named like variables. A for-in loop lets you iterate over all the elements of an object without knowing their names.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...