Introduction to Arrays
In the previous lesson, we learned about conditionals that allow us to determine which parts of the code should be executed based on a condition. In this lesson, we will look at another important concept in programming - arrays.
Arrays allow us to store multiple values in a single variable. We can think of an array as a list that contains different items.
For example, if we have a list of students in a class, we don't need to store each student's name in a new variable, but we can store their names in one array.
const students = ["Jennifer", "Boris", "Nancy", "David", "Ava"];
Arrays are very useful when we need to work with a larger amount of data.
Now that we know what an array is, we can start with exercises to practice working with arrays!
Instructions
On the next line, add: console.log(students);
Start programming for free
1/10