{"ScriptPreparationCode":"var testObj = {\r\n \u0022content\u0022: [\r\n {\r\n \u0022columnGap\u0022: 10,\r\n \u0022columns\u0022: [\r\n {\r\n \u0022svg\u0022: \u0022\\n \u003Csvg\u003E\u003Cpath/\u003E\u003C/svg\u003E\u0022,\r\n\t\t \u0022width\u0022: 100\r\n },\r\n {\r\n \u0022style\u0022: \u0022reportMainHeading\u0022,\r\n \u0022text\u0022: \u0022Azure-Central-US\u0022,\r\n \u0022width\u0022: \u0022*\u0022 \r\n }\r\n ]\r\n },\r\n {\r\n \u0022canvas\u0022: [\r\n {\r\n \u0022lineColor\u0022: \u0022#CCCCCC\u0022,\r\n \u0022lineWidth\u0022: 3,\r\n \u0022type\u0022: \u0022line\u0022\r\n }\r\n ],\r\n \u0022margin\u0022: [0, 10]\r\n }\r\n ]\r\n};\r\n\r\nvar recursiveDeepCopy = (obj) =\u003E {\r\n if (Array.isArray(obj)) {\r\n return [...obj].map(v =\u003E {\r\n return v?.constructor === Object ? recursiveDeepCopy(v) : v;\r\n });\r\n } else if (obj \u0026\u0026 obj?.constructor === Object) {\r\n return Object.keys(obj).reduce((v, d) =\u003E {\r\n const curr = obj[d];\r\n let updatedV = curr;\r\n if (curr?.constructor === Object || Array.isArray(curr)) {\r\n updatedV = recursiveDeepCopy(curr);\r\n } else if (typeof curr === \u0027function\u0027) { // remove pure functions from object\r\n updatedV = undefined;\r\n }\r\n return Object.assign(v, updatedV === undefined ? {} : {\r\n [d]: updatedV\r\n });\r\n }, {});\r\n }\r\n return obj;\r\n};\r\n\r\nvar jsonDeepCopy = (obj) =\u003E {\r\n \treturn JSON.parse(JSON.stringify(obj)); \r\n}\r\n\r\n","TestCases":[{"Name":"recursiveDeepCopy","Code":"recursiveDeepCopy(testObj);","IsDeferred":false},{"Name":"jsonDeepCopy","Code":"jsonDeepCopy(testObj);","IsDeferred":false}]}