Arrays Basics

Arrays are ordered lists of values. They can store any type of data and are zero-indexed.

const fruits = ["apple", "banana", "cherry"];
console.log(fruits[0]); // Output: apple

You can modify arrays directly:

fruits[1] = "blueberry";
fruits.push("date");
← PrevNext →