{"ScriptPreparationCode":"function getItems(count) {\r\n return _.times(count, (index) =\u003E ({\r\n name: \u0060city${i}\u0060,\r\n visited: true\r\n }))\r\n}\r\n\r\nvar items = getItems(100000)","TestCases":[{"Name":"for...of","Code":"const result = {};\r\nfor(let item of items) {\r\n result[item.name] = item.visited;\r\n}","IsDeferred":false},{"Name":"reduce spread","Code":"let initial = {};\r\nconst result = items.reduce((accumulator, item) =\u003E ({\r\n ...accumulator,\r\n [item.name]: item\r\n}), initial);","IsDeferred":false},{"Name":"reduce mutate","Code":"let initial = {};\r\nconst result = items.reduce((accumulator, item) =\u003E {\r\n accumulator[item.name] = item\r\n return accumulator\r\n}, initial);","IsDeferred":false},{"Name":"object.fromEntries ...map","Code":"let result = Object.fromEntries(\r\n items.map((item) =\u003E [item.name, item])\r\n);","IsDeferred":false},{"Name":"Lodash Keyby","Code":"_.keyBy(items, (item) =\u003E item.name)","IsDeferred":false}]}