What you'll build
- A vote counter that tallies whether a measure passes or fails.
- A tracker that comments on your progress towards a daily goal.
- A filter that seeks out messages that contain a certain word.
What you'll learn
- How to group items together into a single collection.
- How to perform functions on a whole collection of items at once.
Key vocabulary
Introduction
The power of programming lies in the fact that your work is reusable. If you wrote
a function that turned one photo into a black-and-white image, you could use it on all your photos just by calling it with the correct arguments.
That works great if you're transforming and storing each photo individually. But what if you wanted to process a collection of photos all at once? In this lesson, you’ll work on storing and transforming groups of items so you can reuse your work with even greater efficiency and power.
Go Build
Open the Arrays and Loops.playground file in your course resources and follow the instructions.

Reflection Questions
Think of a couple collections you have in real life, whether photos, device cables, socks, or cousins.
What are actions you'd want to take on each item in the group? Make up some function names and write pseudocode to describe the actions. For example:
for friend in soccerFriends {
greet(friend)
invite(friend, toGame: "US-Mexico exposition game")
sayGoodbyeTo(friend)
}
Think of an app you use that has collections of similar items, like photos, messages, video game characters, or something else entirely. Write down your guesses for what you think those collections might be named in the app's code, remembering to use camel case. Also write down your guess about what type of thing makes up those collections.
Summary
Arrays are important data abstractions. They help you work with large collections of items as groups without having to manage lots of separate variables. Collections of data such as arrays are what empower loops—and loops are an example of the core procedural abstraction of iteration.
You've looped over arrays by writing code that executes the same steps for every item in a collection, and you even created your own collections of numbers and strings. In the next lesson, you'll see how to make and use custom types that you design yourself.
Remember
Collections of data such as arrays are what empower loops.