{"ScriptPreparationCode":"function arrayFilter(data, filterFn) {\r\n const length = data.length;\r\n // we go from back to front to avoid index problems (elements change on the same index) and length changes\r\n for (let i = length - 1; i \u003E= 0; i--) {\r\n if (filterFn(data[i]) === false) {\r\n data.splice(i, 1);\r\n }\r\n }\r\n return data;\r\n}","TestCases":[{"Name":"custom array filter","Code":"const testData = [];\r\nfor(let i=0; i\u003C100; i\u002B\u002B) {\r\n testData.push(i % 2);\r\n}\r\n\r\n\r\narrayFilter(testData, i=\u003E!i);","IsDeferred":false},{"Name":"custom array filter with bigger array","Code":"const testData = [];\r\nfor(let i=0; i\u003C100; i\u002B\u002B) {\r\n testData.push(i % 2);\r\n}\r\nfor(let i=0; i\u003C100; i\u002B\u002B) {\r\n testData.push(0);\r\n}\r\n\r\n\r\narrayFilter(testData, i=\u003E!i);","IsDeferred":false},{"Name":"Array.filter","Code":"const testData = [];\r\nfor(let i=0; i\u003C100; i\u002B\u002B) {\r\n testData.push(i % 2);\r\n}\r\n\r\ntestData.filter(i =\u003E !i);","IsDeferred":false}]}