I’m translating some Clojure
code to Javascript
for my job for transparency for the UI team and I realized why I prefer Clojure for Javascript. Here's the problem:
Select only unique objects from a list
Javascript:
const myDistinctArray = [
...new Set(myObjArray.map(JSON.stringify)),
].map(JSON.parse);
or
// This one presumes unique "id" === unique object
let uniqueObjArray = […