I would like to delete a property and return a new object without mutating the original object.
I know we can do this easily with Lodash like this:
const profile = { name: 'Maria', age: 30 }
_.omit(profile, name) // it returns a new object without the property name {age: 30}
However, I would like to know if it's possible to do it with vanilla JavaScript without assigning that value to undefined
or using a filter
?