Manipulating Arrays

Learn to create, manipulate, and traverse arrays, including 2D arrays, in JavaScript.

An array in JavaScript is a data structure used to store multiple values in a single variable. These values can be of any data type, and arrays are especially useful for managing lists or sequences of items. Arrays in JavaScript are zero-indexed, meaning the first element is accessed with an index 0.

Syntax of arrays

The syntax of arrays in JavaScript is as follows:

Get hands-on with 1400+ tech skills courses.