Arrays hold lists of things, and nearly every program uses them.
Direct answer
A JavaScript array is an ordered list written in square brackets. Items are accessed by index starting at 0. Use push and pop to add and remove items, and map, filter and reduce to transform lists.
The basics
const fruits = ["apple", "banana", "cherry"];
console.log(fruits[0]); // apple
console.log(fruits.length); // 3
fruits.push("date"); // add to end
fruits.pop(); // remove from end
The big three
const nums = [1, 2, 3, 4, 5];
const doubled = nums.map(n => n * 2); // [2, 4, 6, 8, 10]
const evens = nums.filter(n => n % 2 === 0); // [2, 4]
const sum = nums.reduce((total, n) => total + n, 0); // 15
Other handy methods
| Method | What it does |
|---|---|
find | first item that passes a test |
includes | checks if a value exists |
slice | copies part of an array |
sort | orders items |
Where Teyro fits
Teyro's JavaScript for Beginners course turns this into short lessons you can play in a few minutes a day. It has 50 lessons, and you can start free.
The bottom line
Learn map, filter and reduce early. They replace many loops.



