passer l'objet par valeur js

JSON.parse(JSON.stringify(obj)) //is a fast way to copy your objects, if your objects can be serialized to json.
https://aybee.codes