DEV Community

Discussion on: ✨ How to Immutably remove property from JavaScript Object

Collapse
 
steve_53b0d637d98a profile image
Steve Saxon • Edited

Your final code snippet has a typo. For example, node.js will give you the error: "ReferenceError: obj2 is not defined".

Instead try this: let { twitter, ...obj2 } = obj;

Collapse
 
ahmedgmurtaza profile image
Ahmed Murtaza

Corrected now, thanks for identifying 👍