{"ScriptPreparationCode":"function flatten(arr) {\r\n\tlet i = 0;\r\n\tconst len = arr.length;\r\n\tconst result = [];\r\n\tlet item;\r\n\r\n\twhile (i \u003C len) {\r\n\t\titem = Array.isArray(arr[i]) ? flatten(arr[i]) : [arr[i]];\r\n\t\t[].push.apply(result, item);\r\n\t\ti \u002B= 1;\r\n\t}\r\n\r\n\treturn result;\r\n}","TestCases":[{"Name":"Custom Flatten Function","Code":"var params = [ \u0022hello\u0022, true, 7 ];\r\nvar other = flatten([1, 2, params]);","IsDeferred":false},{"Name":"Array.prototype.flat","Code":"var params = [ \u0022hello\u0022, true, 7 ];\r\nvar other = [1, 2, params].flat()","IsDeferred":false}]}