{"ScriptPreparationCode":"function getRandomElement(id) {\r\n return {\r\n id,\r\n a: Math.random(),\r\n b: Math.random(),\r\n c: Math.random(),\r\n }\r\n}\r\n\r\nfunction getArray(length) {\r\n const result = [];\r\n for (let i = 0; i \u003C length; i\u002B\u002B) {\r\n result.push(getRandomElement(i))\r\n }\r\n \r\n return result;\r\n}\r\n\r\nfunction arrayToMap(array) {\r\n return new Map(array.map(el =\u003E [el.id, el]));\r\n}\r\n\r\nfunction getRandomInt(max) {\r\n return Math.floor(Math.random() * max);\r\n}\r\n\r\narray_small = getArray(3);\r\narray_large = getArray(10);\r\n\r\nmap_small = arrayToMap(array_small);\r\nmap_large = arrayToMap(array_large);","TestCases":[{"Name":"Array.find, 10 000 elements","Code":"const target = getRandomInt(2);\r\narray_small.find(el =\u003E el.id === target);","IsDeferred":false},{"Name":"Map.get, 10 000 elements","Code":"const target = getRandomInt(2);\r\nmap_small.get(target);","IsDeferred":false},{"Name":"Array.find, 1 000 000 elements ","Code":"const target = getRandomInt(9);\r\narray_large.find(el =\u003E el.id === target);","IsDeferred":false},{"Name":"Map.get, 1 000 000 elements","Code":"const target = getRandomInt(9);\r\nmap_large.get(target)","IsDeferred":false}]}