The One Thing That Made Me Choose Clojure Over Javascript — How Simplicity Wins

const myDistinctArray = [
...new Set(myObjArray.map(JSON.stringify)),
].map(JSON.parse);
// This one presumes unique "id" === unique object 
let uniqueObjArray = [
...new Map(
objArray.map((item) => [item["id"], item])
).values(),
];
(distinct my-object-list) // that's it

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store