{"ScriptPreparationCode":"function recursiveDeepCopy(o) {\r\n var newO,\r\n i;\r\n \r\n if (typeof o !== \u0027object\u0027) {\r\n return o;\r\n }\r\n if (!o) {\r\n return o;\r\n }\r\n \r\n if (\u0027[object Array]\u0027 === Object.prototype.toString.apply(o)) {\r\n newO = [];\r\n for (i = 0; i \u003C o.length; i \u002B= 1) {\r\n newO[i] = recursiveDeepCopy(o[i]);\r\n }\r\n return newO;\r\n }\r\n \r\n newO = {};\r\n for (i in o) {\r\n if (o.hasOwnProperty(i)) {\r\n newO[i] = recursiveDeepCopy(o[i]);\r\n }\r\n }\r\n return newO;\r\n }\r\n\r\nvar MyObject = [\r\n {\r\n \u0022key\u0022: \u0022categories.id\u0022,\r\n \u0022values\u0022: [\r\n \u00227549d23f-ef1a-4e2a-9649-2b6ca3d7a2d0\u0022,\r\n \u0022ef7504a4-97c9-4efa-a6d2-ec25ebc953c2\u0022\r\n ]\r\n },\r\n {\r\n \u0022key\u0022: \u0022variants.attributes.ageRangeFacets\u0022,\r\n \u0022values\u0022: [\r\n \u00226\u002B\u0022,\r\n \u00229\u002B\u0022\r\n ]\r\n },\r\n {\r\n \u0022key\u0022: \u0022variants.scopedPrice.currentValue.centAmount\u0022,\r\n \u0022ranges\u0022: [\r\n {\r\n \u0022from\u0022: \u00220\u0022,\r\n \u0022to\u0022: \u00222000\u0022\r\n },\r\n {\r\n \u0022from\u0022: \u002210000\u0022,\r\n \u0022to\u0022: \u002220000\u0022\r\n }\r\n ]\r\n }\r\n];\r\n\r\nvar myCopy = null;","TestCases":[{"Name":"Lodash","Code":"myCopy = _.cloneDeep(MyObject);","IsDeferred":false},{"Name":"Custom function","Code":"myCopy = recursiveDeepCopy(MyObject);","IsDeferred":false},{"Name":"JSON.parse","Code":"myCopy = JSON.parse(JSON.stringify(MyObject));","IsDeferred":false},{"Name":"structuredClone","Code":"myCopy = structuredClone(MyObject);","IsDeferred":false}]}