Array methods (map, filter, reduce)

Built-in helpers to transform lists without writing loops.

Also called: map, filter, reduce, find, forEach, sort

Domain
Languages
Type
Term
Source
General
Language
JavaScript

Example

filter keeps the paid bookings, and reduce adds up their totals.

In code

const paid = bookings.filter(b => b.status === 'paid');
const names = paid.map(b => b.guest);
const revenue = paid.reduce((sum, b) => sum + b.total, 0);
bookings.find(b => b.id === 7);
bookings.some(b => b.nights > 14);
[...names].sort((a, b) => a.localeCompare(b));

Learn more

Related terms

Added 2026-11-30 · Last reviewed 2026-11-30