Create a cheap clone of Object – Vue

Here's an obvious bit of code (obvious when you know about it) 🤦🏻‍♂️

How to create a clone of a Vue object without the bindings?

The snippet is not really about Vue but that's where I needed it

JSON.parse( JSON.stringify( myObject ) );

For a Vue option, I have read about the extend util but didn't work out in my scenario.

Vue.util.extend( {}, this.myObject );

More information

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*