{"ScriptPreparationCode":"function trimArrayReduce(array, filter) {\r\n return array.reduce((p, c) =\u003E p.length \u003E 0 ? [...p, c] : filter(c) ? [] : [c], [])\r\n .reduceRight((p, c) =\u003E p.length \u003E 0 ? [c, ...p] : filter(c) ? [] : [c], []);\r\n}\r\n\r\nfunction trimArrayLodash(array, filter) {\r\n return _.dropRightWhile(_.dropWhile(a, filter), filter)\r\n}\r\n\r\na = [0, 0, 0, 0, 0, 0, 1, 2, 5,6,7,8,6,4,3,5,7,8, 3, 0, 0, 0, 6,5,3,3,6,7,23,5,7,2,2,3, 8, 9, 4, 0, 0, 0, 0];","TestCases":[{"Name":"lodash","Code":"b = trimArrayLodash(a, (v) =\u003E v === 0);\r\n","IsDeferred":false},{"Name":"reduce","Code":"b = trimArrayReduce(a, (v) =\u003E v === 0);","IsDeferred":false}]}