{"ScriptPreparationCode":"var params = [[ 1, 2 ], [ \u0022hello\u0022, true, 7 ]];\r\nfunction getTotal(arr) {\r\n let total = 0;\r\n for (let i = 0; i \u003C arr.length; i\u002B\u002B) {\r\n total \u002B= arr[i].length; \r\n }\r\n return total;\r\n}","TestCases":[{"Name":"reduce \u002B Array.prototype.concat","Code":"return params.reduce((acc, val) =\u003E acc.concat(val), []);","IsDeferred":false},{"Name":"Array.prototype.flat","Code":"return params.flat();","IsDeferred":false},{"Name":"Manual copy by index #1","Code":"const result = new Array(getTotal(params));\r\nfor (let i = 0; i \u003C params.length; i\u002B\u002B) {\r\n for (let j = 0; j \u003C params[i].length; j\u002B\u002B) {\r\n result[params[i].length * i \u002B j] = params[i][j]; \r\n }\r\n}\r\nreturn result;","IsDeferred":false},{"Name":"Manual copy by index #2","Code":"const result = new Array(getTotal(params));\r\nfor (let i = 0, k = 0; i \u003C params.length; i\u002B\u002B) {\r\n const arr = params[i];\r\n for (let j = 0; j \u003C arr.length; j\u002B\u002B) {\r\n result[k] = arr[j];\r\n k\u002B\u002B;\r\n }\r\n}\r\nreturn result;","IsDeferred":false},{"Name":"Manual copy with push","Code":"const result = [];\r\nfor (let i = 0; i \u003C params.length; i\u002B\u002B) {\r\n const arr = params[i];\r\n for (let j = 0; j \u003C arr.length; j\u002B\u002B) {\r\n result.push(arr[j]);\r\n }\r\n}\r\nreturn result;","IsDeferred":false}]}