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:
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: