Lists, Arrays & Collections
Collections let you store multiple values in one variable. Loops, filters, and maps operate on collections in every Swift program.
- Ordered lists — arrays, lists, vectors
- Key-value maps — objects, dictionaries, hashes
- Immutable vs mutable collections
- Iteration with for loops and higher-order methods
SWIFT
// Collections in swift- Choose the right structure — array for ordered data, map for lookups
- Prefer built-in methods over manual index loops when available
- Watch for off-by-one errors in index-based loops