{"ScriptPreparationCode":"var test = [{\r\n id: \u0027a1\u0027,\r\n value: 20\r\n}, {\r\n id: \u0027a2\u0027,\r\n value: 15\r\n}, {\r\n id: \u0027a3\u0027,\r\n value: 40\r\n}, {\r\n id: \u0027a1\u0027,\r\n value: 99\r\n}, {\r\n id: \u0027a2\u0027,\r\n value: 30\r\n}]","TestCases":[{"Name":"Object.values \u002B reduce","Code":"var result = Object.values(test.reduce((acc, curr) =\u003E {\r\n\tif (!acc[curr.id] || acc.value \u003C curr.value) {\r\n \tacc[curr.id] = curr\r\n }\r\n \treturn acc\r\n}, {}))","IsDeferred":false},{"Name":"Lodash orderBy \u002B uniqBy","Code":"var result = _(test).orderBy([\u0027id\u0027, \u0027value\u0027], [\u0027asc\u0027, \u0027desc\u0027]).uniqBy(\u0027id\u0027).value()","IsDeferred":false},{"Name":"Lodash map \u002B groupBy \u002B maxBy","Code":"var result = _.map(_.groupBy(test, \u0027id\u0027), g =\u003E _.maxBy(g, \u0027value\u0027))","IsDeferred":false}]}