So far, we've worked with variables that hold a single value, like a string, number, or a boolean. Arrays are a way to store multiple values in a variable.
You can think of an array as a list of items. Here's how you create an array:
let fruits = ["apple", "banana", "cherry"];Notice the square brackets [] and commas separating each item.
When you print an array to the console, you'll see all the values it contains.
Add two more foods to the array. Make sure to separate each item with a comma.
No variables
Output (Console)