What is the Array map() method?

Answer

The map() method creates a new array by calling a callback function on every element of the original array and collecting the return values. The original array is not modified. Syntax: const doubled = [1, 2, 3].map(x => x * 2)[2, 4, 6]. The callback receives three arguments: the current element, its index, and the full array. Use map when you want to transform every element: users.map(user => user.name), data.map(item => ({...item, active: true})). The returned array always has the same length as the original. For side effects only (no transformation), use forEach(). Map is chainable: arr.filter(...).map(...).reduce(...). Since map returns a new array, it is a pure functional operation — great for immutable data patterns in React state management.