{"ScriptPreparationCode":"var angularFilter = angular.injector([\u0027ng\u0027]).get(\u0027$filter\u0027)(\u0027filter\u0027);\r\n\r\n// Add array.where implementation\r\nArray.prototype.where = Array.prototype.where || function(predicate) {\r\n var results = [],\r\n len = this.length,\r\n i = 0;\r\n\r\n for (; i \u003C len; i\u002B\u002B) {\r\n var item = this[i];\r\n if (predicate(item)) {\r\n results.push(item);\r\n }\r\n }\r\n\r\n return results;\r\n};\r\n\r\n// Generate test array\r\nwindow.array = (function() {\r\n var arr = [];\r\n for (var i = 0; i \u003C 100; \u002B\u002Bi) {\r\n arr.push(i);\r\n }\r\n\r\n return arr;\r\n}());\r\n\r\ngrepAlone = function( elems, callback, invert ) {\r\n\t\tvar callbackInverse,\r\n\t\t\tmatches = [],\r\n\t\t\ti = 0,\r\n\t\t\tlength = elems.length,\r\n\t\t\tcallbackExpect = !invert;\r\n\r\n\t\t// Go through the array, only saving the items\r\n\t\t// that pass the validator function\r\n\t\tfor ( ; i \u003C length; i\u002B\u002B ) {\r\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\r\n\t\t\tif ( callbackInverse !== callbackExpect ) {\r\n\t\t\t\tmatches.push( elems[ i ] );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn matches;\r\n};\r\n\r\nArray.prototype.find = function(predicate) {\r\n if (this == null) {\r\n throw new TypeError(\u0027Array.prototype.find called on null or undefined\u0027);\r\n }\r\n if (typeof predicate !== \u0027function\u0027) {\r\n throw new TypeError(\u0027predicate must be a function\u0027);\r\n }\r\n var list = Object(this);\r\n var length = list.length \u003E\u003E\u003E 0;\r\n var thisArg = arguments[1];\r\n var value;\r\n\r\n for (var i = 0; i \u003C length; i\u002B\u002B) {\r\n value = list[i];\r\n if (predicate.call(thisArg, value, i, list)) {\r\n return value;\r\n }\r\n }\r\n return undefined;\r\n};\r\n\r\nfunction getValue(el) {\r\n\treturn el - 50 \u003E 31;\r\n}","TestCases":[{"Name":"array.find","Code":"array.find(getValue);","IsDeferred":false},{"Name":"array.filter","Code":"array.filter(getValue);","IsDeferred":false}]}