You are not recognized as the original poster of this topic.
structuredClone();:
function clone(object){
if(object===null||typeof object!=="object")return object;
let copy=Array.isArray(object)?[]:{},value;
for(let key in object){
value=object[key];
copy[key]=typeof value==="object"?clone(value):value;
}
return copy;
}