I have an array of objects
const target = [{name: 'srk@gmail.com', selected: false, alertType: 'max'},
{name: 'abc@gmail.com', 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: 'srk@gmail.com', selected: false, alertType: 'both'}