An array is an ordered collection of data (either primitive or object depending upon the language). Arrays are used to store multiple values in a single variable. This is compared to a variable that can store only one value.
Each item in an array has a number attached to it, called a numeric index, that allows you to access it. In JavaScript, arrays start at index zero and can be manipulated with various methods.
What an array in JavaScript looks like:
var myArray = [1, 2, 3, 4];
var catNamesArray = ["Jacqueline", "Sophia", "Autumn"];
//Arrays in JavaScript can hold different types of data, as shown above.
Learn more
General knowledge
- Array on Wikipedia
Technical reference
- JavaScript
Array
on MDN
Document Tags and Contributors
Tags:
Contributors to this page:
KurtHarlandLarson,
Sheppy,
aapiane09,
SnoopyRules,
klez,
Andrew_Pfeiffer,
Jeremie,
hbloomer,
alispivak,
panaggio
Last updated by:
KurtHarlandLarson,