I am trying to adddata from another object into a new object while also adding new data
const addCardData = { ...optIn, cardId, cardName}
here optIn already has cardId and cardName so they are getting replaced by new values, how to make an addCardData such that cardId and cardName not be replaced but added to the object or as a sub object? or is there any other better way to do this?