re: Much needed filterMap in JavaScript VIEW POST

TOP OF THREAD FULL DISCUSSION
re: It is 80% slower, jsperf.com/array-filtermap/2
 

Yeah, sorry, been using array destructuring too much lately. If it's speed we're going after we can't create a new array at each iteration step.

const emails = customers.reduce(
  (prev, c) => {
    if (c.active) prev.push(c)
    return prev
  },
  []
)

This way reduce can be used as map as well, nice trick but I still prefer filterMap for its smaller syntax.

code of conduct - report abuse