{"ScriptPreparationCode":"var MyObject = {\r\n description: \u0027Creates a deep copy of source, which should be an object or an array.\u0027,\r\n myNumber: 123456789,\r\n myBoolean: true,\r\n jayson: {\r\n stringify: \u0027JSON.stringify() method converts a JavaScript value to a JSON string....\u0027,\r\n parse: \u0027JSON.parse() method parses a JSON string...\u0027\r\n }\r\n};\r\n\r\nvar myCopy = null;\r\n\r\nfunction deepClone(obj) {\r\n if (obj === null || typeof obj !== \u0022object\u0022) return obj;\r\n\r\n const copy = Array.isArray(obj) ? [] : {};\r\n\r\n for (const key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n copy[key] = deepClone(obj[key]);\r\n }\r\n }\r\n\r\n return copy;\r\n}\r\n","TestCases":[{"Name":"JSON.stringify","Code":"myCopy = JSON.parse(JSON.stringify(MyObject));","IsDeferred":false},{"Name":"structuredClone","Code":"myCopy = structuredClone(MyObject);","IsDeferred":false},{"Name":"deepClone","Code":"myCopy = deepClone(MyObject);","IsDeferred":false}]}