const deepCopy = (obj)=>{ const newObj = {}; for (const i in obj) { newObj[i] = typeof obj[i] === "object" ? deepCopy(obj[i]) : obj[i]; } }