What are arrays?
Arrays store multiple values in a single variable. You’ll use them constantly — lists of users, product catalogs, API responses, form options, navigation items. Any time you have a collection of things, that’s an array.- JavaScript
- Python
Accessing items
Getting the last item
Array length
.length is a property, not a method. No parentheses needed.
Modifying arrays
Checking if something is in an array
- JavaScript
- Python
.includes() where Python uses in. Both check for existence.
Slicing arrays
.slice() returns a new array without modifying the original. Same behavior as Python’s list[1:3], just with method syntax instead of bracket notation.
What’s next?
You can create and access arrays. Now let’s learn the methods that make arrays truly powerful —.map(), .filter(), .find(), and more.
Array methods
Transform, filter, and search arrays