I have an array of objects
const target = [{name: '[email protected]', selected: false, alertType: 'max'},
{name: '[email protected]', selected: true, alertType: 'clear'},]
now i want to update the array based on name and alertType. for ex: if name and alertType matches then update the selected property. if that doesn't match add a new Object. new Object is
const = {name: '[email protected]', selected: false, alertType: 'both'}