One line javascript function to remove property from object without mutating it

The following code seems like a nice approach to remove property from a javascript object without mutating it:

const removeKey = (data, key) => { return {...data, [key]: undefined} }Code language: JavaScript (javascript)

Source: