DEV Community

Discussion on: How the delete operator can be your super saver

Collapse
 
blindfish3 profile image
Ben Calder

+1 to this approach. When the anticipated result is a same length array with derived data map() is the best fit; and extracting desired properties is a safer approach than mutating the source object.

I personally like reduce(), but would only use it when both filtering and deriving data.