JavaScript Arrays
An array is a data structure that stores a collection of values. Arrays are indexed, which means that each value in the array has a unique index.
JavaScript Array Syntax
The syntax for a JavaScript array is as follows:
const arrayName = [value1, value2, value3, ...];
The arrayName is the name of the array. The values are the values in the array.
Here is an example of a JavaScript array:
const fruits = ["Apple", "Banana", "Orange"];
This array has three values: “Apple”, “Banana”, and “Orange”. The values in the array are indexed, so the value “Apple” has the index 0, the value “Banana” has the index 1, and the value “Orange” has the index 2.