{"ScriptPreparationCode":null,"TestCases":[{"Name":"Using Object","Code":"const arr = [\r\n {name: \u0027name1\u0027, prop: \u0027prop\u0027}, \r\n {name: \u0027name2\u0027, prop: \u0027prop\u0027}, \r\n {name: \u0027name3\u0027, prop: \u0027prop\u0027}, \r\n {name: \u0027name4\u0027, prop: \u0027prop\u0027}\r\n]\r\n\r\nconst obj = {};\r\n\r\narr.forEach(a =\u003E obj[a.name] = a)","IsDeferred":false},{"Name":"Using Map()","Code":"const arr = [\r\n {name: \u0027name1\u0027, prop: \u0027prop\u0027}, \r\n {name: \u0027name2\u0027, prop: \u0027prop\u0027}, \r\n {name: \u0027name3\u0027, prop: \u0027prop\u0027}, \r\n {name: \u0027name4\u0027, prop: \u0027prop\u0027}\r\n]\r\n\r\nconst mp = new Map();\r\narr.forEach((a) =\u003E {\r\n mp.set(a.name, a);\r\n});","IsDeferred":false}]}