Module 7 · Arrays and the Array Methods: The map, filter, reduce Pipeline
Every Array Method, One by One, With What It Returns
Free with an accountReading
Amara's bookshop keeps its shelf as an array of titles. In one afternoon she adds new books, sells some from the middle, sorts the shelf by price, and looks one title up. Every one of those jobs is a single method call. The trick is knowing which method, and one more thing: does it change her shelf, or hand her a new one?
Checking what this lesson needs for you…
What is inside Every Array Method, One by One, With What It Returns
- push and pop: the fast end
- shift and unshift: the slow end
- Holes and the sparse trap
- slice copies, splice changes
- indexOf, includes, find and findIndex
- sort and its comparator
- reverse
- concat and the spread copy
- flat and flatMap
- join
- Array.from, Array.of and fill
- forEach, map, filter and reduce
- some and every
- The ES2023 copies: toSorted, toReversed, toSpliced and with
- Changes the array, or returns a new one