The Array
The Numbered Shelf

An array is a numbered shelf for your data. Each item gets its own fixed slot, accessible instantly by its index number. This makes lookups incredibly fast. But the shelf has a fixed size; once it's full, you can't easily add more space. It’s a disciplined, efficient organizer.
// A shelf with three fixed slots
const numberedShelf: string[] = ["Book", "Photo Frame", "Clock"];
// Instantly access the item at slot 0 (0-indexed)
const item = numberedShelf[0]; // "Book"
// Instantly access the item at slot 1 (0-indexed)
const item = numberedShelf[1]; // "Photo Frame"
// Instantly access the item at slot 2 (0-indexed)
const item = numberedShelf[2]; // "Clock"





