Iterating through collections Programming


show more An array is a collection of data, in much the same way that a music CD is a collection of songs. When you're playing a CD, you need to skip through the collection of songs to get to the one you want; in an array, you may need to iterate through collections of data to get what you need. This Lynda.com online video explains the basics of manipulating arrays in this manner. show less
please wait ...

Iterating through collections

Arrays are one of the most common things you're find in all programming languages and to get the right perspective here don't think so much of the word array, but think of the wider idea of collections and think of how many different kinds of applications you have in your computer that are really collections of things. Your email program is a collection of emails, your address book is a collection of contacts, your MP3 player containing a collection of albums and playlists, each one being a collection of songs. They're everywhere in programming.

And an array is the most fundamental straightforward kind of collection you can have. Now one of the most common things you'll ever need to do is to iterate through or loop through every element in an array and this is actually a very easy thing to do. You don't really need to know much about the array to do it. So let's take a look. So let's say I have a simple array here with five elements in. It doesn't matter ...

Iterating through collections
Video duration: 5m 18s 4h 47m Beginner

Viewers:

An array is a collection of data, in much the same way that a music CD is a collection of songs. When you're playing a CD, you need to skip through the collection of songs to get to the one you want; in an array, you may need to iterate through collections of data to get what you need. This Lynda.com online video explains the basics of manipulating arrays in this manner.

Subjects:
Developer Web
Author:
please wait ...