Skip to main content
D
JavaScript
JavaScript Arrays

JavaScript Arrays

JavaScript arrays store multiple values inside a single variable.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

JavaScript uses arrays to hold lists of data, like a shopping list or a catalog of products. Instead of creating ten different variables for ten cars, developers put all ten cars inside one array.

Example

Example
1/* this creates an array */
2const cars = ["Saab", "Volvo", "BMW"];
3let firstCar = cars[0];

Key Points

  • Arrays use square brackets to hold data.
  • Commas separate each item in the array.
  • The first item sits at index 0.
  • Developers typically declare arrays with `const`.

Up Next

Continue your journey with the next topic.

Go to JS Array Methods