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));
Related Contents:
- Most efficient method to groupby on an array of objects
- JavaScript merging objects by id
- Add property to an array of objects
- Comparing two arrays of objects, and exclude the elements who match values into new array in JS
- Convert array of strings into an array of objects
- Javascript group objects by property [closed]
- break array of objects into separate arrays based on a property
- Update if exists or add new element to array of objects – elegant way in javascript + lodash
- Better way to sum a property value in an array
- Group array of object nesting some of the keys with specific names
- Convert array to JSON
- How to add same elements to javascript array n times
- Copy array items into another array
- How to add an object to an array
- How to split a long array into smaller arrays, with JavaScript
- Merge JavaScript objects in array with same key
- Check if an element is present in an array [duplicate]
- Sort mixed alpha/numeric array
- Find and remove objects in an array based on a key value in JavaScript
- Comparing Arrays of Objects in JavaScript
- Javascript sort function. Sort by First then by Second
- How to compare two objects and get key-value pairs of their differences?
- Compare JavaScript Array of Objects to Get Min / Max
- sort Javascript array by two numeric fields
- How to know if two arrays have the same values
- Is reading the `length` property of an array really that expensive an operation in JavaScript?
- JavaScript runtime complexity of Array functions
- Difference and intersection of two arrays containing objects
- Array.includes() to find object in array
- Big O of JavaScript arrays
- Javascript Set vs. Array performance
- Recursively filter array of objects
- How to find the array index with a value?
- Reverse array in Javascript without mutating original array
- JavaScript Loops: for…in vs for
- Check if array contains all elements of another array
- How might I extract the property values of a JavaScript object into an array?
- How can I reverse an array in JavaScript without using libraries?
- Javascript: filter array of objects by array of strings
- How to check if a string array contains one string in JavaScript? [duplicate]
- Convert ES6 Iterable to Array
- Do objects pushed into an array in javascript deep or shallow copy?
- How do you search an array for a substring match?
- Why is ‘for(var item in list)’ with arrays considered bad practice in JavaScript?
- How to store a byte array in Javascript
- How to merge each object within arrays by index?
- Javascript – remove an array item by value [duplicate]
- Javascript recursive array flattening
- How to convert array of key–value objects to array of objects with a single property?
- Two arrays, where items in array x can be in array y but not vice versa, test all permutations