My goal is to search for matches in Object 2 where the _type corresponds to filterByCallTypeTitulo in Object 1, and then create a new array including all the matched information from Object 2.
I attempted to achieve this using the filter() method and forEach, but unfortunately, I have not been successful so far (likely due to my incorrect implementation).
This is an example of what I have tried:
callDataList.filter(value => value.type === filters.voiceFilterViewModel.filterByCallTypeTitulo);
Details of Object 1 (filters.voiceFilterViewModel):
VoiceFilterViewModel {_filterByDateTime: "Duración", _filterByAscDesc: "Descendente", _arrayCallType: Array(1), _filterByCallTypeTitulo: "Internacionales"}
arrayCallType: Array(1)
0: VoiceFilterItemViewModel
callTypes: null
titulo: "Internacionales"
_callTypes: null
_titulo: "Internacionales"
__proto__: Object
length: 1
__proto__: Array(0)
filterByAscDesc: "Descendente"
filterByCallTypeTitulo: "Internacionales"
filterByDateTime: "Duración"
__proto__: Object
Details of Object 2 (callDataList):
0: DetailedUsageVoiceModel {_duration: 601, _cost: 0, _type: "Móvil Nacional", _usageDate: Moment, _usageType: "VOZ", …}
1: DetailedUsageVoiceModel {_duration: 79, _cost: 0, _type: "Móvil Nacional", _usageDate: Moment, _usageType: "VOZ", …}
2: DetailedUsageVoiceModel {_duration: 1314, _cost: 0, _type: "Numeración corta", _usageDate: Moment, _usageType: "VOZ", …}
Detailed Information on Object 2:
0: DetailedUsageVoiceModel
calledNumber: (...)
origin: (...)
startDate: (...)
trafficType: (...)
type: "Móvil Nacional"