const deepCopy = (obj) => JSON.parse(JSON.stringify(obj));
const deepCopy = (obj) => JSON.parse(JSON.stringify(obj));
clonedArray = nodesArray.map(a => {return {...a}})
clonedArray = nodesArray.map(a => {return {...a}})
let clonedArray = JSON.parse(JSON.stringify(nodesArray))
array2 = structuredClone(array1);