DEV Community

cortim
cortim

Posted on

Quick Tip: Array of unique values

Original array with duplicates:
const nonUnique = [1, 4, 1, 3, 3]

Array with unique values only:
const uniqueArr = [...new Set(nonUnique)] // [1, 4, 3]

Top comments (0)