{"ScriptPreparationCode":" var array = [];\r\n for (var idx = 0; idx \u003C 1000; idx\u002B\u002B) {\r\n array[idx] = idx;\r\n }\r\n \r\n function oddNum(item) {\r\n return item % 2;\r\n }\r\n \r\n // Create a new array and push to it\r\n Array.prototype.pushFilter = function(condition) {\r\n // Create a new array and push to it\r\n var result = [],\r\n i, len;\r\n for(i = 0, len = this.length; i \u003C len; i\u002B\u002B) {\r\n if (condition(this[i], i, this)) \r\n result.push(this[i]);\r\n }\r\n return result;\r\n };\r\n \r\n // Clone array and then remove items\r\n Array.prototype.spliceFilter = function(condition) {\r\n var result = this.slice(),\r\n i = result.length;\r\n while (i--) {\r\n if (!condition(result[i], i, this))\r\n result.splice(i, 1);\r\n }\r\n return result;\r\n };\r\n \r\n // Create a new array and push to it with \u0027this\u0027 arg\r\n Array.prototype.pushFilterThis = function(condition, thisArg) {\r\n // Create a new array and push to it\r\n var result = [],\r\n i, len;\r\n for(i = 0, len = this.length; i \u003C len; i\u002B\u002B) {\r\n if(condition.call(thisArg, this[i], i, this)) \r\n result.push(this[i]);\r\n }\r\n return result;\r\n };\r\n \r\n // Clone array and then remove items with \u0027this\u0027 arg\r\n Array.prototype.spliceFilterThis = function(condition, thisArg) {\r\n var result = this.slice(),\r\n i = result.length;\r\n while (i--) {\r\n if (!condition.call(thisArg, result[i], i, this))\r\n result.splice(i, 1);\r\n }\r\n return result;\r\n };","TestCases":[{"Name":"spliceFilterThis","Code":"var result = array.spliceFilterThis(oddNum, {});","IsDeferred":false},{"Name":"pushFilterThis","Code":"var result = array.pushFilterThis(oddNum, {});","IsDeferred":false},{"Name":"spliceFilter","Code":"var result = array.spliceFilter(oddNum);","IsDeferred":false},{"Name":"filter","Code":"var result = array.filter(oddNum);","IsDeferred":false},{"Name":"pushFilter","Code":"var result = array.pushFilter(oddNum);","IsDeferred":false}]}