const nums = [1, 2, 3, 4, 5];
const evens = nums.filter(n => n % 2 === 0);
// evens: [2, 4]- The callback should return true (keep) or false (discard)
- Returns a new array — the length can be shorter than the original
- Commonly chained with .map() to transform and narrow data in one pipeline