Chapter 8. Arrays: putting data into lists
This chapter covers
- Grouping values as lists
- Creating an array
- Accessing elements in an array
- Manipulating the elements in an array
- Using forEach to visit each element
Almost everything youâve covered so far has been about organizing your data or organizing your code. This chapter continues that theme but with a twist: itâs not just about grouping items; now you can put them in order.
In The Crypt, youâll finally have the ability for players to collect items they find on the journey; with arrays they can start on their very own treasure hoards.
8.1. Creating arrays and accessing elements
Working with lists is an essential part of programming. Blog posts, quiz questions, stock prices, ...