Array Reduce Function Typescript Map Method In Salesforce