[Solved] How can I find objects with same keys values in array?
If that is the exact solution that you want. Following code snippet may help you. const arr = [ { type: ‘type’, fields: [‘field1’]}, { type: ‘type2’}, { type: ‘type’, fields: [‘field2’]} ] const modifyArr = (data) => { let res = []; arr.map((item) => { if(item.type == data.type){ if(Object.keys(item).includes(‘fields’)){ res = res.concat(item.fields); } } … Read more