# Array methods you reach for
URL: https://wwadd.dev/moves/javascript/array-methods

`map` transforms, `filter` narrows, `reduce` folds. All three return new values — none of them mutate. `sort` and `reverse` DO mutate, so copy first with `toSorted` or a spread.


```javascript
const users = [{ name: "Ada", age: 36 }, { name: "Linus", age: 54 }];

const names = users.map((u) => u.name);
const adults = users.filter((u) => u.age >= 18);
const total = users.reduce((sum, u) => sum + u.age, 0);
const found = users.find((u) => u.name === "Ada");
const anyOver50 = users.some((u) => u.age > 50);
const allAdults = users.every((u) => u.age >= 18);

// non-mutating sort
const byAge = [...users].sort((a, b) => a.age - b.age);
```

## Related Moves
- [fetch JSON with error handling](https://wwadd.dev/moves/javascript/fetch-json)
- [Promises and async patterns](https://wwadd.dev/moves/javascript/promises)

