{"ScriptPreparationCode":"function concatMap1(xs, fn) {\r\n return xs.map(v =\u003E fn(v)).reduce((acc, arr) =\u003E Array.isArray(arr) ? acc.concat(arr) : acc.concat([arr]), []);\r\n}\r\n\r\nfunction concatMap2(xs, fn) {\r\n var res = [];\r\n for (var i = 0; i \u003C xs.length; i\u002B\u002B) {\r\n var x = fn(xs[i], i);\r\n if (Array.isArray(x)) res.push.apply(res, x);\r\n else res.push(x);\r\n }\r\n return res;\r\n}\r\n","TestCases":[{"Name":"concat 1","Code":"concatMap1(Array(1000).fill(0), v =\u003E [v-1, v, v\u002B1])","IsDeferred":false},{"Name":"concat 2","Code":"concatMap2(Array(1000).fill(0), v =\u003E [v-1, v, v\u002B1])","IsDeferred":false},{"Name":"concat 1 small to large","Code":"concatMap1([1, 2, 3, 4], v =\u003E Array(1000).fill(v))","IsDeferred":false},{"Name":"concat 2 small to large","Code":"concatMap2([1, 2, 3, 4], v =\u003E Array(1000).fill(v))","IsDeferred":false}]}