Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/glossary/array/index.md
6520 views
---
title: Array slug: Glossary/Array page-type: glossary-definition
---

An array is an ordered collection of data (either {{Glossary("primitive")}} or {{Glossary("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 {{Glossary("Method", "methods")}}.

What an array in JavaScript looks like:

let myArray = [1, 2, 3, 4]; let catNamesArray = ["Jacqueline", "Sophia", "Autumn"]; //Arrays in JavaScript can hold different types of data, as shown above.

See also

  • Array on Wikipedia

  • JavaScript {{jsxref("Array")}} on MDN