{"ScriptPreparationCode":"const DATA = {}\r\n\r\nfor (let keyIndex = 1; keyIndex \u003C= 10; keyIndex\u002B\u002B) {\r\n const key = \u0060key${keyIndex}\u0060; // Dynamically generate key names\r\n const objectsArray = [];\r\n\r\n for (let n = 1; n \u003C= 10000; n\u002B\u002B) {\r\n objectsArray.push({ id: n % 35 }); // Push objects with id: n % 35\r\n }\r\n\r\n DATA[key] = objectsArray; // Assign the array to the key\r\n }","TestCases":[{"Name":"Filter and FindIndex","Code":"const groupedWithoutDuplicates = {}\r\nObject.keys(DATA).forEach((key) =\u003E {\r\n groupedWithoutDuplicates[key] = DATA[key].filter(\r\n (item, index, self) =\u003E index === self.findIndex((t) =\u003E t.id === item.id)\r\n )\r\n})","IsDeferred":false},{"Name":"Filter and IndexOf","Code":"const groupedWithoutDuplicates = {}\r\nObject.entries(DATA).forEach(([key, value]) =\u003E {\r\n const ids = value.map((item) =\u003E item.id)\r\n groupedWithoutDuplicates[key] = value.filter((item, index) =\u003E index === ids.indexOf(item.id))\r\n})","IsDeferred":false},{"Name":"Lodash","Code":"const groupedWithoutDuplicates = {}\r\nObject.entries(DATA).forEach(([key, value]) =\u003E {\r\n groupedWithoutDuplicates[key] = _.uniqBy(value, \u0027id\u0027)\r\n})","IsDeferred":false}]}