17: Sequences and For Loops

Most programming languages have some way to store data inside the computer. For some languages that storage is just raw memory locations, but programmers easily make mistakes when that's the case. In modern languages you're provided with some core ways to store data called "data structures". A data structure takes pieces of data (integers, strings, and even other data structures) and organizes them in some useful way. In this exercise we'll learn about the sequence style of data structures called a "list" or "Array" depending on the language.

JavaScript's simplest sequence data structure is the Array which is an ordered list of things. You can access the elements of an Array randomly, in order, extend it, shrink it, and most anything else you could do to a sequence of things in real life.

You make an Array like this:

let fruit = ["apples", "oranges", "grapes"];

Learn JavaScript Today

Register today for the Beginner Basics course and get the new releases by just paying the difference. There's also special discounts for existing customers when new courses are released.


Still Not Sure? Check out more curriculum!