DEV Community

Discussion on: Become a Javascript Magician with these tricks!

Collapse
 
curiousdev profile image
CuriousDev

Thanks, but for the unique items it most likely only works for simple data types, like numbers and strings. For complex objects you still should write a function, which would do the comparison in order to know, which objects are supposed to be the same. Maybe there is also a function for this, but it surely will not be simple.

Collapse
 
sobhandash profile image
Sobhan Dash

I think we can use the Set function with addition to map or filter functions to create the uniqueFinder function that you are talking about