{"ScriptPreparationCode":null,"TestCases":[{"Name":"Using filter","Code":"const data = [...Array(1000).keys()]\r\ndata.filter(n =\u003E n % 2 === 0)","IsDeferred":false},{"Name":"Using while loop","Code":"const arrayRemove = function(array, predicate){\r\n let i = -1,\r\n len = array ? array.length : 0;\r\n const result = [];\r\n\r\n while (\u002B\u002Bi \u003C len) {\r\n const value = array[i];\r\n if (predicate(value, i, array)) {\r\n result.push(value);\r\n Array.prototype.splice.call(array, i--, 1);\r\n len--;\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n\r\nconst data = [...Array(1000).keys()]\r\narrayRemove(data, n =\u003E n % 2 === 0)","IsDeferred":false}]}