+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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
+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.