Array methods (map, filter, reduce)

Higher-order array methods transform data without an explicit loop: map returns a new array with each element transformed, filter keeps only those that satisfy a condition, reduce combines all the elements into a single value. They do not modify the original array.

Example

[1, 2, 3, 4].filter(n => n % 2 === 0).map(n => n * 10)  // [20, 40]

Related concepts

The whole glossary