What is an array

In JavaScript, an array is a collection of values. It is a comma-separated list of values enclosed in a pair of square brackets. An array can be stored as a single variable. For example, ["apple", "mango", "banana"] is an array of strings. It can be stored as a variable, as shown in the code below:

Get hands-on with 1200+ tech skills courses.