{"ScriptPreparationCode":"var params = [];\r\nfor (let i = 0; i \u003C 100; i\u002B\u002B) {\r\n const arr = [];\r\n for (let j = 0; j \u003C 1000; j\u002B\u002B) {\r\n arr.push(999 * Math.random());\r\n }\r\n params.push(arr);\r\n}\r\n\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 concat","Code":"return params.reduce((acc, val) =\u003E acc.concat(val), []);","IsDeferred":false},{"Name":"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},{"Name":"reduce \u002B spread","Code":"return params.reduce((acc, val) =\u003E [...acc, ...val], []);","IsDeferred":false}]}