{"ScriptPreparationCode":"var personListA = [\r\n {\r\n id: 1,\r\n name: \u0022Thompson Gregory\u0022,\r\n age: 24\r\n },\r\n {\r\n id: 2,\r\n name: \u0022Orr Mcdonald\u0022,\r\n age: 37\r\n },\r\n {\r\n id: 3,\r\n name: \u0022Patterson Cline\u0022,\r\n age: 36\r\n },\r\n {\r\n id: 4,\r\n name: \u0022Ryan Roy\u0022,\r\n age: 26\r\n },\r\n {\r\n id: 5,\r\n name: \u0022Johnston Foreman\u0022,\r\n age: 36\r\n },\r\n {\r\n id: 6,\r\n name: \u0022Bowers Cortez\u0022,\r\n age: 29\r\n },\r\n {\r\n id: 7,\r\n name: \u0022Bernard Pena\u0022,\r\n age: 38\r\n },\r\n {\r\n id: 8,\r\n name: \u0022Gladys Spears\u0022,\r\n age: 26\r\n },\r\n {\r\n id: 9,\r\n name: \u0022Pittman Cain\u0022,\r\n age: 40\r\n },\r\n {\r\n id: 10,\r\n name: \u0022Carver Wall\u0022,\r\n age: 26\r\n },\r\n {\r\n id: 11,\r\n name: \u0022Mara Massey\u0022,\r\n age: 37\r\n },\r\n {\r\n id: 12,\r\n name: \u0022Fletcher Peck\u0022,\r\n age: 20\r\n },\r\n {\r\n id: 13,\r\n name: \u0022Bentley Moran\u0022,\r\n age: 34\r\n },\r\n {\r\n id: 14,\r\n name: \u0022Ellison Witt\u0022,\r\n age: 33\r\n }\r\n]\r\n\r\nvar personListB = [{\r\n id: 15,\r\n name: \u0022Freida Ramsey\u0022,\r\n age: 35\r\n },\r\n {\r\n id: 16,\r\n name: \u0022Hines Zimmerman\u0022,\r\n age: 27\r\n },\r\n {\r\n id: 17,\r\n name: \u0022Miranda Gilliam\u0022,\r\n age: 31\r\n },\r\n {\r\n id: 18,\r\n name: \u0022Alejandra Dunlap\u0022,\r\n age: 29\r\n },\r\n {\r\n id: 19,\r\n name: \u0022Lynnette Sawyer\u0022,\r\n age: 39\r\n },\r\n {\r\n id: 20,\r\n name: \u0022Katy Adams\u0022,\r\n age: 33\r\n },\r\n {\r\n id: 21,\r\n name: \u0022Howe Wilcox\u0022,\r\n age: 21\r\n },\r\n {\r\n id: 22,\r\n name: \u0022Paige Holmes\u0022,\r\n age: 32\r\n },\r\n {\r\n id: 23,\r\n name: \u0022Mable Estrada\u0022,\r\n age: 34\r\n },\r\n {\r\n id: 24,\r\n name: \u0022York Lopez\u0022,\r\n age: 36\r\n },\r\n {\r\n id: 25,\r\n name: \u0022Kris Mejia\u0022,\r\n age: 29\r\n },\r\n {\r\n id: 26,\r\n name: \u0022Carlson Payne\u0022,\r\n age: 27\r\n },\r\n {\r\n id: 27,\r\n name: \u0022Staci Flores\u0022,\r\n age: 34\r\n },\r\n {\r\n id: 28,\r\n name: \u0022Eloise Lowe\u0022,\r\n age: 25\r\n },\r\n {\r\n id: 29,\r\n name: \u0022Lyons Hicks\u0022,\r\n age: 30\r\n },\r\n {\r\n id: 30,\r\n name: \u0022Goodwin Castro\u0022,\r\n age: 31\r\n }]","TestCases":[{"Name":"Lodash","Code":"var uniquePersons = _.chain(personListA)\r\n .concat(personListB)\r\n .uniqBy((person) =\u003E person.age)\r\n .orderBy(\r\n (person) =\u003E [person.age, person.id],\r\n [\u0022desc\u0022, \u0022desc\u0022]\r\n )\r\n .value();","IsDeferred":false},{"Name":"Native Array","Code":"var uniquePersons = [...personListA, ...personListB]\r\n /** Avoid duplicate, filter by unique age */\r\n .filter((person, index, all) =\u003E all.findIndex((p) =\u003E p.age === person.age) === index)\r\n /** Sort by age in descending order */\r\n .sort((a, b) =\u003E a.age - b.age);","IsDeferred":false}]}