Wagner Souza Posted on Dec 2, 2021 • Edited on Dec 2, 2021 Get all unique values from an array 💡 #tip - How to remove duplicate items in the array? It's simple!👇 const array = [1, 2, 2, 3, 4, 4]; const uniqueValues = [...new Set(array)]; // [1, 2, 3, 4] Enter fullscreen mode Exit fullscreen mode 📚 References ... (spread operator) - MDN new Set - MDN Top comments (0) Subscribe Submit Preview Dismiss Code of Conduct • Report abuse
Top comments (0)