{"ScriptPreparationCode":"const uniqueItems = {};\r\n\r\nconst arr = [{\r\n place: \u0022here\u0022,\r\n name: \u0022x\u0022,\r\n other: \u0022other stuff1\u0022\r\n },\r\n {\r\n place: \u0022there\u0022,\r\n name: \u0022x\u0022,\r\n other: \u0022other stuff2\u0022\r\n },\r\n {\r\n place: \u0022here\u0022,\r\n name: \u0022y\u0022,\r\n other: \u0022other stuff4\u0022\r\n },\r\n {\r\n place: \u0022here\u0022,\r\n name: \u0022z\u0022,\r\n other: \u0022other stuff5\u0022\r\n }\r\n]\r\n\r\nfunction getUniqueListByFilter() {\r\n return arr.filter((element) =\u003E {\r\n if (uniqueItems[element.place]) {\r\n return false;\r\n }\r\n\r\n uniqueItems[element.place] = true;\r\n\r\n return true;\r\n });\r\n}\r\n\r\nfunction getUniqueListByMap() {\r\n return [...new Map(arr.map(item =\u003E [item.place, item])).values()]\r\n}","TestCases":[{"Name":"use Map","Code":"const arr1 = getUniqueListByMap()","IsDeferred":false},{"Name":"use Filter","Code":"const arr2 = getUniqueListByFilter()","IsDeferred":false}]}