How does the .map(), .filter(), and .reduce() methods work in arrays?

map transforms each array element, filter selects elements based on a condition, and reduce accumulates array values into a single result.

const numbers = [1, 2, 3, 4];
const squares = numbers.map(n => n * n); // [1, 4, 9, 16]