Method 1: Comparing two objects based on reference: The strict equals (===) operator compares memory locations in case of comparing objects.
Example 2:Drawback of using JSON.stringify() method. If the order of data inside an object changes, then the above method does not work properly. This is the drawback of using JSON.stringify() method as demonstrated below.
- Extract unique objects by attribute from array of objects.
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.