Array Methods (map / filter / reduce)
Transforming (map), filtering (filter), and reducing arrays to a single value (reduce) — the heart of modern JS.
Simple enough for a 5-year-old to understand
map: transform
Applies an operation to each element and produces a NEW array. Does not modify the original.
const prices = [100, 200];const withVat = prices.map(f => f * 1.2);console.log(withVat);filter: filter
const numbers = [1, 2, 3, 4];const evens = numbers.filter(x => x % 2 === 0);console.log(evens);🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (1 left)
🎯 Expected output: [ 2, 4 ]