Add map function based on forEach utility function

-Instead of passing action and array directly to forEach, pass an array
with an anonymous function and have the anonymous function apply the
action.

-The anonymous function 'opens up' the parent function it is in because
it allows direct access to the array elements