{"ScriptPreparationCode":"var items = [];\r\n var names = [\u0027george\u0027, \u0027nick\u0027, \u0027jack\u0027, \u0027herodotus\u0027, \u0027joanne\u0027];\r\n for (var i = 0; i \u003C 2000; i\u002B\u002B) {\r\n var obj = {\r\n name: names[i % 5] \u002B \u0027-\u0027 \u002B i,\r\n age: i % 10 \u002B 15\r\n };\r\n items.push(obj);\r\n }\r\n function filter_callback(item) {\r\n return (item.age == \u002718\u0027);\r\n }","TestCases":[{"Name":"test_filter","Code":"aged_18_filter = items.filter(filter_callback);","IsDeferred":false},{"Name":"test_loop","Code":"var aged_18_loop = [];\r\n for (var i = 0; i \u003C items.length; i\u002B\u002B) {\r\n if (items[i].age == \u002718\u0027) {aged_18_loop.push(items[i]);}\r\n }","IsDeferred":false},{"Name":"test_loop_optimized","Code":"var length= items.length;\r\nvar aged_18_loop=new Array(length);\r\n for (var i = 0; i \u003C length; i\u002B\u002B) {\r\n if (items[i].age == \u002718\u0027) {aged_18_loop[i]=items[i];}\r\n }","IsDeferred":false}]}