Jump to content

For....In Explaining


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...