I need to update Existing object conditionally using spread operator. Below my code
const resetPerson: any = {...person, name: '', age: '', location && location : '' };
if location key exist in person object then only clear location else no need to add location property.
How can I do that.