Knowledge Maxxing
← Back to topic library
Dev MaxxingBeginnerJavaScript60 sec

Array

An array is an ordered list of values in JavaScript, each accessible by its numeric position, or index, starting at zero.

Prerequisite: JavaScript object

What matters

Because order and position matter, arrays are the natural structure for sequences, like a list of items, where you often need to loop through or access elements by position.

Example

Given an array '["a", "b", "c"]', the first element is accessed as index 0, returning 'a'.

Common misconception

An array's index does not start at 1; JavaScript arrays are zero-indexed, so the first element is always at position 0.

Recall question

What position does the first element of a JavaScript array sit at?

Keywords and related concepts

arrayindexordered listjavascript object

Related topics

JavaScript object
Dev MaxxingBeginner
JavaScript function
Dev MaxxingBeginner