Foreach Loops7:23 with Alena Holligan
I've saved the best for last! Foreach loops are my favorite when looping through arrays. You can use foreach loops with any type of array, and your array can have any key value. You can choose to grab just the item value or the key value as well. A foreach loop is a lot like combining the WHILE statement with the each function, only even easier.
You need to sign up for Treehouse in order to download course files.Sign up