Remove duplicates from an array

March 17, 2021 1 min read
const array = [1, 1, 2, 2, 3, 3, 'ReactJS', 'ReactJS']

[...new Set(array)] // [1, 2, 3, 'ReactJS']