{"ScriptPreparationCode":"var intMap = new Map();\r\nvar stringMap = new Map();\r\n\r\n// arrays of keys so they don\u0027t have to construct them in the test cases\r\nvar stringKeys = [];\r\nvar intKeys = [];\r\n\r\nfor (let i = 0; i \u003C 1000; i\u002B\u002B) {\r\n // identical values\r\n var value = \u0022test123\u0022 \u002B i.toString()\r\n intMap.set(i, value);\r\n intKeys.push(i);\r\n stringMap.set(i.toString(), value);\r\n stringKeys.push(i.toString());\r\n}\r\n\r\nfunction shuffle(array) {\r\n let currentIndex = array.length;\r\n\r\n // While there remain elements to shuffle...\r\n while (currentIndex != 0) {\r\n\r\n // Pick a remaining element...\r\n let randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex--;\r\n\r\n // And swap it with the current element.\r\n [array[currentIndex], array[randomIndex]] = [\r\n array[randomIndex], array[currentIndex]];\r\n }\r\n}\r\n\r\n// for the tests later\r\nvar stringOutputValues = [];\r\nvar intOutputValues = [];\r\n\r\n// shuffle the arrays so they don\u0027t benefit from any order advantages\r\nshuffle(stringKeys);\r\nshuffle(intKeys);","TestCases":[{"Name":"string map","Code":"let i = 0;\r\nfor (const stringKey of stringKeys) {\r\n // do (identical) work w/ the values so there\u0027s no optimisation.\r\n // adds [accessNum, value concat accessNum] to the stringOutputValues array\r\n stringOutputValues.push([i.toString(), stringMap.get(stringKey) \u002B i.toString()]);\r\n i\u002B\u002B;\r\n}","IsDeferred":false},{"Name":"int map","Code":"let i = 0;\r\nfor (const intKey of intKeys) {\r\n // do (identical) work w/ the values so there\u0027s no optimisation.\r\n // adds [accessNum, value concat accessNum] to the intOutputValues array\r\n intOutputValues.push([i.toString(), intMap.get(intKey) \u002B i.toString()]);\r\n i\u002B\u002B;\r\n}","IsDeferred":false}]}