map transforms items, filter retains matching items, reduce accumulates a result, and forEach calls a callback for side effects and returns undefined. Without an initial accumulator, reduce uses the first present element and throws if no present element exists. Use an explicit initial value when the accumulator type differs or input may be empty.
Follow-up Interview Question · Why does awaiting forEach(async callback) not wait for its callbacks?