{"ScriptPreparationCode":"var elements = [1, [2, [3, [4]], 5]];\r\n\r\nconst flattenDeep = (arr) =\u003E Array.isArray(arr)\r\n ? arr.reduce( (a, b) =\u003E a.concat(flattenDeep(b)) , [])\r\n : [arr];\r\n\r\nconst flattenDeepL = (arr) =\u003E arr.flatMap((subArray, index) =\u003E Array.isArray(subArray) ? flattenDeepL(subArray) : subArray);","TestCases":[{"Name":"_.flattenDeep","Code":"_.flattenDeep(elements);","IsDeferred":false},{"Name":"// Native","Code":"const flattenDeep = (arr) =\u003E Array.isArray(arr)\r\n ? arr.reduce( (a, b) =\u003E a.concat(flattenDeep(b)) , [])\r\n : [arr];\r\n\r\nflattenDeep(elements)","IsDeferred":false},{"Name":"Native(ES2019)","Code":"elements.flat(Infinity)","IsDeferred":false},{"Name":"native 2","Code":"const flattenDeep = (arr) =\u003E arr.flatMap((subArray, index) =\u003E Array.isArray(subArray) ? flattenDeep(subArray) : subArray)\r\n\r\nflattenDeep(elements)","IsDeferred":false}]}