mdn.go-v.org

Array

An array is an ordered collection of data (either primitive or object depending upon the language). Arrays are used to store multiple values under a single variable name. A regular variable, on the other hand, can store only one value.

source: MDN Web Docslicence: CC BY-SA 2.5+ (MDN)database: /home/dbs/mdn.dbmode: tablerecords: 14753 (max_rowid)citation: https://developer.mozilla.org/

An array is an ordered collection of data (either primitive or object depending upon the language). Arrays are used to store multiple values under a single variable name. A regular variable, on the other hand, can store only one value.

Full text

An **array** is an ordered collection of data (either primitive or object depending upon the language). Arrays are used to store multiple values under a single variable name. A regular variable, on the other hand, 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.

Arrays in JavaScript look like this:

```js
// Arrays in JavaScript can hold different types of data
const myArray = [1, 2, 3, 4];
const barbieDollNamesArray = ["Barbie", "Ken", "Midge", "Allan", "Skipper"];

// Array indexes starts at 0.
console.log(myArray[0]); // output: 1
console.log(barbieDollNamesArray[2]); // output: "Midge"
```

## See also

- JavaScript Array

Fields

page_typeglossary-definition
tags

Cite this record

MLA
"Array." MDN Web Docs, n.d., https://mdn.go-v.org/record/Glossary%2FArray.

Chicago
"Array." MDN Web Docs. n.d.. https://mdn.go-v.org/record/Glossary%2FArray.

APA
MDN Web Docs. (n.d.). Array. https://mdn.go-v.org/record/Glossary%2FArray

Share card · JSON record

source: MDN Web Docslicence: CC BY-SA 2.5+ (MDN)year: —id: Glossary/Arraycitation: https://developer.mozilla.org/en-US/docs/Glossary/Array

JSON · full text · full-text JSON ·

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.