{"ScriptPreparationCode":"var sampleData = [];\r\nfor (var i=0; i \u003C 1000; i\u002B\u002B){ \r\n sampleData.push({value: (Math.floor(Math.random() * 1000))});\r\n}\r\n\r\nvar selectorFn = function(x) { \r\n return x.value; \r\n}","TestCases":[{"Name":"Native Sort DESC","Code":"var order = \u0022desc\u0022;\r\n\r\nsampleData.sort(function(a,b){\r\n\tvar x = selectorFn(a); var y = selectorFn(b);\r\n\tvar res = ((x \u003C y) ? -1 : ((x \u003E y) ? 1 : 0));\r\n\r\n\treturn order === \u0022desc\u0022 ? -1*res : res;\r\n})","IsDeferred":false},{"Name":"Native Sort ASC","Code":"var order = \u0022asc\u0022;\r\n\r\nsampleData.sort(function(a,b){\r\n\tvar x = selectorFn(a); var y = selectorFn(b);\r\n\tvar res = ((x \u003C y) ? -1 : ((x \u003E y) ? 1 : 0));\r\n\r\n\treturn order === \u0022desc\u0022 ? -1*res : res;\r\n})","IsDeferred":false}]}