Plain javascript (ES2015), using Set
const list = [{ x: 1, y: 2 }, { x: 3, y: 4 }, { x: 5, y: 6 }, { x: 1, y: 2 }];
const uniq = new Set(list.map(e => JSON.stringify(e)));
const res = Array.from(uniq).map(e => JSON.parse(e));
document.write(JSON.stringify(res));
More Related Contents:
- Most efficient method to groupby on an array of objects
- JavaScript merging objects by id
- Add property to an array of objects
- Convert array of strings into an array of objects
- Comparing two arrays of objects, and exclude the elements who match values into new array in JS
- Javascript group objects by property [closed]
- break array of objects into separate arrays based on a property
- Sorting an Array of JavaScript Objects a Specific Order (using existing function)
- Array.prototype.fill() with object passes reference and not new instance
- Why can I add named properties to an array as if it were an object?
- Is the order of elements in a JSON list preserved?
- JavaScript: How to join / combine two arrays to concatenate into one array?
- Sum JavaScript object propertyA values with the same object propertyB in an array of objects
- How might I extract the property values of a JavaScript object into an array?
- Sampling a random subset from an array
- Convert JavaScript array of 2 element arrays into object key value pairs
- How to check if a string array contains one string in JavaScript? [duplicate]
- Count duplicates within an Array of Objects
- MongoDB select where in array of _id?
- Search array of objects for entry matching variable and check if it matches other fields
- How can I perform an inner join with two object arrays in JavaScript?
- How to get the first element of an array?
- Javascript 2d array indexOf
- How to merge each object within arrays by index?
- Convert js Array() to JSon object for use with JQuery .ajax
- How to find a value in an array of objects in JavaScript?
- Javascript: hiding prototype methods in for loop?
- Return an object key only if value is true
- Array Of JS Dates How To Group By Days
- Javascript: Sort array of arrays by second element in each inner array