Creating Lists and Indexing
Build lists and access items by position.
What a List Is
A List is an ordered bucket of values you can hold in one variable. Think of it as a numbered row of boxes, each storing one item. 📦
Your First List
Write a list with square brackets and commas. The literal below holds three fruit names in the exact order you typed them.
var fruits = ['apple', 'banana', 'cherry'];All lessons in this course
- Creating Lists and Indexing
- Adding, Removing, and Updating Items
- Searching and Sorting Lists
- Transforming With map, where, and toList