{"ScriptPreparationCode":"var i = 0, count = 100000, a;\r\nvar map = new Map();\r\n\r\nfor (i = 0; i \u003C count; i\u002B\u002B) {\r\n if (Math.round(Math.random() * 1000)) {\r\n map.set(i, i * i);\r\n }\r\n}","TestCases":[{"Name":"Use array methods","Code":"var values = Array.from(map.values());\r\nvar chunkSize = 2000;\r\nvar count = 1;\r\nvar chunk = [];\r\nfor (let i = 0; i \u003C values.length; i \u002B= chunkSize) {\r\n chunk = values.slice(i, i \u002B chunkSize);\r\n \tconsole.log(count, chunk.length);\r\n \tcount\u002B\u002B;\r\n}","IsDeferred":false},{"Name":"Use map enumerator","Code":"var chunk = [];\r\nvar chunkSize = 2000;\r\nvar count = 1;\r\nfor (let [a,b] of map) {\r\n if(chunk.length \u003C= chunkSize) {\r\n\tconsole.log(count, chunk.length);\r\n chunk = [];\r\n \tcount\u002B\u002B;\r\n }\r\n}","IsDeferred":false}]}