I just came across this concept of
var copy = Object.assign({}, originalObject);
which creates a copy of original object into the \"
For small Data structures I see that JSON.stringify() and JSON.parse() work nice.
// store as JSON
var copyOfWindowLocation = JSON.stringify(window.location)
console.log("JSON structure - copy:", copyOfWindowLocation)
// convert back to Javascript Object
copyOfWindowLocation = JSON.parse(copyOfWindowLocation)
console.log("Javascript structure - copy:", copyOfWindowLocation)