What's an Array?

An array is a list of items, a bit like a shopping list. It allows you to store more than one item in only one variable.

Think of it like this. When writing your shopping list, you could use a separate piece of paper for each item you need to buy (a variable). However this is silly and unneeded—could you imagine how hard it would be to carry all that paper around with you? So, you use one piece of paper for all of your items. This one piece of paper is your array.

In the editor do you see the bit of text that starts with $array =? That is our array. Don't worry about all the details just yet, we will explain in more detail later. For now, just see if you can work out what is happening.


Once you are ready to move on, click Save & Submit Code.

Stuck? Get a hint! Hint
Get live, fast support from Codecademy Advisors when you get stuck. Learn more.

Have you clicked Submit? There is no need to do anything else in this exercise.

View Preview