loading...

Discussion on: Basic Javascript: Removing Duplicates from an Array

Collapse
ronancodes profile image
Ronan Connolly 🛠

I get a TypeScript error for trying to expand the set.
This works though:

function removeDuplicates(array) {
  return Array.from(new Set(array));
}

Seems like the simplest solution.