loading...

Discussion on: Remove Duplicates In Array

Collapse
eruizdechavez profile image
Erick Ruiz de Chavez

You should probably mention that this only works for primitive values. As soon as you start using objects this approach won't work.

const obj = [{name: 'foo'},{name: 'foo'},{name: 'foo'}];
Collapse
miketalbot profile image
Mike Talbot

It is working in this case, those objects are each unique. It isn't working by comparing the contents of the object for sure.