Looking for a way to extract objects from an array that have the type "noActiveServiceDashboard" and "extraAmountDashboard". I want to create a new array with only these two entries in the same format.
I've attempted using .find() or .filter() methods but I'm facing issues accessing the properties inside.
cmsContentModules: Array<{}>
let filteredModules: Array<{}> = cmsContentModules;
filteredModules
(5) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
0: {cid: "2462437627203", tipo: "Funcional", Titulo: "bannerDashboard", type: "bannerDashboard", literalTitle: "Jazztel rápido y fácil", …}
1: {cid: "2462444315058", tipo: "Funcional", Titulo: "noActiveServiceDashboard", type: "noActiveServiceDashboard", literalTitle: "Hola", …}
2: {cid: "2462396510226", tipo: "Funcional", type: "dashboardLineSelector", idCmsLinkItems: "2462397143052", literalErrorSubtitle: "No se puede cambiar el servicio activo", …}
3: {cid: "2462396519886", tipo: "Funcional", type: "extraAmountDashboard", gasto: "Gasto extra:", idCmsLinkDetailedUsagePage: "2462417671130", …}
4: {cid: "2462396619049", tipo: "ArrayModulos", ModulosArray: Array(14), type: "consumptionsCounters"}
length: 5
__proto__: Array(0)