{"ScriptPreparationCode":"var arr = new Array(100).fill(null).map((val, index) =\u003E index);\r\n\r\nfunction filterMapEntries(\r\n arr,\r\n filterFn,\r\n mapFn,\r\n) {\r\n const result = [];\r\n for (const [i, value] of arr.entries()) {\r\n if (filterFn(value)) {\r\n result.push(mapFn(value, i));\r\n }\r\n }\r\n return result;\r\n}\r\n\r\nfunction filterMapIndices(\r\n arr,\r\n filterFn,\r\n mapFn,\r\n) {\r\n const result = [];\r\n for (let i = 0; i \u003C arr.length; i \u002B= 1) {\r\n const value = arr[i];\r\n if (filterFn(value)) {\r\n result.push(mapFn(value, i));\r\n }\r\n }\r\n return result;\r\n}","TestCases":[{"Name":".filter.map","Code":"const a = arr\r\n\t.filter((val) =\u003E val % 2 === 0)\r\n\t.map((val) =\u003E val \u002B 10);","IsDeferred":false},{"Name":".flatMap","Code":"const a = arr.flatMap((val) =\u003E val % 2 === 0 ? [val \u002B 10] : [])","IsDeferred":false},{"Name":"filterMapEntries","Code":"const a = filterMapEntries(arr, (val) =\u003E val % 2 === 0, (val) =\u003E val \u002B 10);","IsDeferred":false},{"Name":"filterMapIndices","Code":"const a = filterMapIndices(arr, (val) =\u003E val % 2 === 0, (val) =\u003E val \u002B 10);","IsDeferred":false}]}