1
JavaScriptBeginner#arrays
map transforms each element into a new array of the same length. filter keeps elements passing a predicate. reduce folds the array into a single accumulated value. All three are pure and do not mutate the source.
const n = [1,2,3,4]; n.map(x => x*2); // [2,4,6,8] n.filter(x => x % 2 === 0); // [2,4] n.reduce((s,x) => s + x, 0);// 10