Array Reduce Function Typescript Map Example