Arrays are the universal data structure in frontend engineering. Every API returns an array. Every list you render, every table you display, every chart you draw — the underlying data is almost always an array or a collection of arrays.
But real-world data rarely arrives in the shape you need. You transform it before rendering: group products by category, flatten nested comment threads, merge local cart data with server inventory, build a category tree from a flat database result.
These patterns appear constantly across every domain:
- E-commerce: group products by category, aggregate totals per order, filter by nested attributes
- Analytics: bucket events by time window, aggregate counts, build timeseries from flat event logs
- Org charts / file trees: flat-to-tree transform from database rows with id/parentId
- Data sync: merge server state with local optimistic updates by a shared key
map / filter / reduce plus recursion. Master those four building blocks and virtually every array transformation becomes approachable.