{"ScriptPreparationCode":"function makeid(length) {\r\n let result = \u0027\u0027;\r\n const characters = \u0027ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\u0027;\r\n const charactersLength = characters.length;\r\n let counter = 0;\r\n while (counter \u003C length) {\r\n result \u002B= characters.charAt(Math.floor(Math.random() * charactersLength));\r\n counter \u002B= 1;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nvar arr = [];\r\nfor(var i = 0; i \u003C 100000; i\u002B\u002B){\r\n arr.push({value:makeid(5)});\r\n}","TestCases":[{"Name":"Convert During Sort","Code":"arr.sort((l, r) =\u003E {\r\n\tconst a = l.value.toLowerCase();\r\n const b = r.value.toLowerCase();\r\n\r\n if (a \u003C b) {\r\n\t\treturn -1;\r\n\t} else if (b \u003E a) {\r\n\t\treturn 1;\r\n\t} else {\r\n\t\treturn 0;\r\n\t}\r\n});","IsDeferred":false},{"Name":"Map Before Sort","Code":"arr.map(x =\u003E x.value.toLowerCase()).sort((a,b) =\u003E {\r\n\tif (a \u003C b) {\r\n\t\treturn -1;\r\n\t} else if (b \u003E a) {\r\n\t\treturn 1;\r\n\t} else {\r\n\t\treturn 0;\r\n\t}\r\n});","IsDeferred":false},{"Name":"lodash sortBy()","Code":"_.sortBy(arr, (x) =\u003E x.value.toLowerCase());","IsDeferred":false},{"Name":"localeCompare()","Code":"arr.sort((a, b) =\u003E a.value.localeCompare(b.value));","IsDeferred":false}]}