{"ScriptPreparationCode":"function recursiveDeepCopy(obj) {\r\n return Object.keys(obj).reduce((v, d) =\u003E Object.assign(v, {\r\n [d]: (obj[d].constructor === Object) ? recursiveDeepCopy(obj[d]) : obj[d]\r\n }), {});\r\n}\r\n\r\nfunction recursiveDeepCopy2(obj) {\r\n let result = Array.isArray(obj) ? [] : {};\r\n const keys = Object.keys(result);\r\n const length = keys.length;\r\n for (let i = length; i \u003E 0; i--) {\r\n let key = keys[i];\r\n result[key] = typeof obj[key] === \u0027object\u0027 ? recursiveDeepCopy2(obj[key]) : obj[key];\r\n }\r\n return result;\r\n}\r\n\r\nfunction cloneArray(a, cloneObject) {\r\n const keys = Object.keys(a);\r\n const a2 = new Array(keys.length);\r\n for (let i = 0; i \u003C keys.length; i\u002B\u002B) {\r\n const k = keys[i];\r\n const cur = a[k];\r\n if (typeof cur !== \u0027object\u0027 || cur === null) {\r\n a2[k] = cur;\r\n }\r\n else {\r\n a2[k] = cloneObject(cur);\r\n }\r\n }\r\n return a2;\r\n}\r\nfunction deepClone(o) {\r\n if (typeof o !== \u0027object\u0027 || o === null) {\r\n return o;\r\n }\r\n if (Array.isArray(o)) {\r\n return cloneArray(o, deepClone);\r\n }\r\n const o2 = {};\r\n for (const k in o) {\r\n if (Object.hasOwnProperty.call(o, k) === false) {\r\n continue;\r\n }\r\n const cur = o[k];\r\n if (typeof cur !== \u0027object\u0027 || cur === null) {\r\n o2[k] = cur;\r\n }\r\n else {\r\n o2[k] = deepClone(cur);\r\n }\r\n }\r\n return o2;\r\n}\r\nfunction jsonDeepCopy(o) {\r\n return JSON.parse(JSON.stringify(o));\r\n}\r\n\r\nvar dimensions = [{\r\n \u0022dimensions\u0022: [{\r\n \u0022runtime\u0022: {\r\n \u0022common\u0022: {\r\n \u0022client\u0022: null,\r\n \u0022server\u0022: null\r\n }\r\n }\r\n }, {\r\n \u0022device\u0022: {\r\n \u0022android\u0022: null,\r\n \u0022blackberry\u0022: null,\r\n \u0022iemobile\u0022: null,\r\n \u0022iphone\u0022: null,\r\n \u0022ipad\u0022: null,\r\n \u0022kindle\u0022: null,\r\n \u0022opera-mini\u0022: null,\r\n \u0022palm\u0022: null\r\n }\r\n }, {\r\n \u0022environment\u0022: {\r\n \u0022development\u0022: {\r\n \u0022dev\u0022: null,\r\n \u0022test\u0022: null\r\n },\r\n \u0022production\u0022: {\r\n \u0022stage\u0022: null,\r\n \u0022prod\u0022: null\r\n }\r\n }\r\n }, {\r\n \u0022lang\u0022: {\r\n \u0022ar\u0022: {\r\n \u0022ar-JO\u0022: null,\r\n \u0022ar-MA\u0022: null,\r\n \u0022ar-SA\u0022: null,\r\n \u0022ar-EG\u0022: null\r\n },\r\n \u0022bn\u0022: {\r\n \u0022bn-IN\u0022: null\r\n },\r\n \u0022ca\u0022: {\r\n \u0022ca-ES\u0022: null\r\n },\r\n \u0022cs\u0022: {\r\n \u0022cs-CZ\u0022: null\r\n },\r\n \u0022da\u0022: {\r\n \u0022da-DK\u0022: null\r\n },\r\n \u0022de\u0022: {\r\n \u0022de-AT\u0022: null,\r\n \u0022de-DE\u0022: null\r\n },\r\n \u0022el\u0022: {\r\n \u0022el-GR\u0022: null\r\n },\r\n \u0022en\u0022: {\r\n \u0022en-AU\u0022: null,\r\n \u0022en-BG\u0022: null,\r\n \u0022en-CA\u0022: null,\r\n \u0022en-GB\u0022: null,\r\n \u0022en-GY\u0022: null,\r\n \u0022en-HK\u0022: null,\r\n \u0022en-IE\u0022: null,\r\n \u0022en-IN\u0022: null,\r\n \u0022en-MY\u0022: null,\r\n \u0022en-NZ\u0022: null,\r\n \u0022en-PH\u0022: null,\r\n \u0022en-SG\u0022: null,\r\n \u0022en-US\u0022: null,\r\n \u0022en-ZA\u0022: null\r\n },\r\n \u0022es\u0022: {\r\n \u0022es-AR\u0022: null,\r\n \u0022es-BO\u0022: null,\r\n \u0022es-CL\u0022: null,\r\n \u0022es-CO\u0022: null,\r\n \u0022es-EC\u0022: null,\r\n \u0022es-ES\u0022: null,\r\n \u0022es-MX\u0022: null,\r\n \u0022es-PE\u0022: null,\r\n \u0022es-PY\u0022: null,\r\n \u0022es-US\u0022: null,\r\n \u0022es-UY\u0022: null,\r\n \u0022es-VE\u0022: null\r\n },\r\n \u0022fi\u0022: {\r\n \u0022fi-FI\u0022: null\r\n },\r\n \u0022fr\u0022: {\r\n \u0022fr-BE\u0022: null,\r\n \u0022fr-CA\u0022: null,\r\n \u0022fr-FR\u0022: null,\r\n \u0022fr-GF\u0022: null\r\n },\r\n \u0022hi\u0022: {\r\n \u0022hi-IN\u0022: null\r\n },\r\n \u0022hu\u0022: {\r\n \u0022hu-HU\u0022: null\r\n },\r\n \u0022id\u0022: {\r\n \u0022id-ID\u0022: null\r\n },\r\n \u0022it\u0022: {\r\n \u0022it-IT\u0022: null\r\n },\r\n \u0022ja\u0022: {\r\n \u0022ja-JP\u0022: null\r\n },\r\n \u0022kn\u0022: {\r\n \u0022kn-IN\u0022: null\r\n },\r\n \u0022ko\u0022: {\r\n \u0022ko-KR\u0022: null\r\n },\r\n \u0022ml\u0022: {\r\n \u0022ml-IN\u0022: null\r\n },\r\n \u0022mr\u0022: {\r\n \u0022mr-IN\u0022: null\r\n },\r\n \u0022ms\u0022: {\r\n \u0022ms-MY\u0022: null\r\n },\r\n \u0022nb\u0022: {\r\n \u0022nb-NO\u0022: null\r\n },\r\n \u0022nl\u0022: {\r\n \u0022nl-BE\u0022: null,\r\n \u0022nl-NL\u0022: null,\r\n \u0022nl-SR\u0022: null\r\n },\r\n \u0022pl\u0022: {\r\n \u0022pl-PL\u0022: null\r\n },\r\n \u0022pt\u0022: {\r\n \u0022pt-BR\u0022: null\r\n },\r\n \u0022ro\u0022: {\r\n \u0022ro-RO\u0022: null\r\n },\r\n \u0022ru\u0022: {\r\n \u0022ru-RU\u0022: null\r\n },\r\n \u0022sv\u0022: {\r\n \u0022sv-SE\u0022: null\r\n },\r\n \u0022ta\u0022: {\r\n \u0022ta-IN\u0022: null\r\n },\r\n \u0022te\u0022: {\r\n \u0022te-IN\u0022: null\r\n },\r\n \u0022th\u0022: {\r\n \u0022th-TH\u0022: null\r\n },\r\n \u0022tr\u0022: {\r\n \u0022tr-TR\u0022: null\r\n },\r\n \u0022vi\u0022: {\r\n \u0022vi-VN\u0022: null\r\n },\r\n \u0022zh\u0022: {\r\n \u0022zh-Hans\u0022: {\r\n \u0022zh-Hans-CN\u0022: null\r\n },\r\n \u0022zh-Hant\u0022: {\r\n \u0022zh-Hant-HK\u0022: null,\r\n \u0022zh-Hant-TW\u0022: null\r\n }\r\n }\r\n }\r\n }]\r\n}]\r\n","TestCases":[{"Name":"Recursive Deep Copy","Code":"var dimensionsCopy = recursiveDeepCopy(dimensions);","IsDeferred":false},{"Name":"JSON Deep Copy","Code":"var dimensionsCopy = jsonDeepCopy(dimensions);","IsDeferred":false},{"Name":"lodash clone","Code":"var dimensionsCopy = _.cloneDeep(dimensions);","IsDeferred":false},{"Name":"deepclone","Code":"var dimensionsCopy = deepClone(dimensions);","IsDeferred":false},{"Name":"Recursive Deep Copy 2","Code":"var dimensionsCopy = recursiveDeepCopy2(dimensions);","IsDeferred":false}]}