DEV Community

Discussion on: Best way to copy an object in JavaScript?

Collapse
 
pmarino90 profile image
Paolo Marino

Normally I would use lodash's clone() or cloneDeep() to do that, if I have it into the project already, otherwise the good old JSON.parse( JSON.stringify( obj ) ); is always a great option.