function deepCopy(obj) { if (typeof obj === 'object') { var result = Array.isArray(obj) ? [] : {}; for (let i in obj) { result[i] = typeof obj[i] === 'object' ? deepCopy(obj[i]) : obj[i]; } } else { var result = obj; } return result; }
function deepCopy(obj) { if (typeof obj === 'object') { var result = Array.isArray(obj) ? [] : {}; for (let i in obj) { result[i] = typeof obj[i] === 'object' ? deepCopy(obj[i]) : obj[i]; } } else { var result = obj; } return result; }