//Easy way around by using rest parameters
const response = [{
drugName: 'HYDROCODONE-HOMATROPINE MBR',
drugStrength: '5MG-1.5MG',
drugForm: 'TABLET',
brand: false
},
{
drugName: 'HYDROCODONE ABC',
drugStrength: '10MG',
drugForm: 'SYRUP',
brand: true
}]
const output = response.map(({ drugName, ...rest }) => rest)
/* output = [{
drugStrength: '5MG-1.5MG',
drugForm: 'TABLET',
brand: false
},
{
drugStrength: '10MG',
drugForm: 'SYRUP',
brand: true
}]
*/