const filterGreaterThan2AndMapAdd1Reducer = (a, x) => { if(x > 2) { return mapAdd1Reducer(a, x) } else { return a; } } [1, 2, 3].reduce(filterGreaterThan2AndMapAdd1Reducer, []);