{"ScriptPreparationCode":null,"TestCases":[{"Name":"Clone","Code":"const clone = (items) =\u003E items.map(item =\u003E Array.isArray(item) ? clone(item) : item);\r\n\r\nvar nestedArray = [[1], [2], [3]];\r\nvar arrayCopy = clone(nestedArray);\r\n// Make some changes\r\narrayCopy[0][0] = \u0027?\u0027; // change shallow element\r\narrayCopy[1][0] = \u0027?\u0027; // change nested element\r\n","IsDeferred":false},{"Name":"JSON.stringify\u002BJSON.parse","Code":"var nestedArray = [[1], [2], [3]];\r\nvar arrayCopy = JSON.parse(JSON.stringify(nestedArray));\r\n// Make some changes\r\narrayCopy[0][0] = \u0027?\u0027; // change shallow element\r\narrayCopy[1][0] = \u0027?\u0027; // change nested element\r\n","IsDeferred":false},{"Name":"Slice","Code":"const clone = (items) =\u003E items.map(item =\u003E item.slice());\r\n\r\nvar nestedArray = [[1], [2], [3]];\r\nvar arrayCopy = clone(nestedArray);\r\n// Make some changes\r\narrayCopy[0][0] = \u0027?\u0027; // change shallow element\r\narrayCopy[1][0] = \u0027?\u0027; // change nested element\r\n","IsDeferred":false},{"Name":"Slice(0)","Code":"const clone = (items) =\u003E items.map(item =\u003E item.slice(0));\r\n\r\nvar nestedArray = [[1], [2], [3]];\r\nvar arrayCopy = clone(nestedArray);\r\n// Make some changes\r\narrayCopy[0][0] = \u0027?\u0027; // change shallow element\r\narrayCopy[1][0] = \u0027?\u0027; // change nested element\r\n","IsDeferred":false}]}