JavaScript 2025 · Arrays
Remove duplicates
Convert to a Set and back to an array.
const unique = [...new Set(items)];
Official JavaScript 2025 documentation
JavaScript 2025 · Arrays
Convert to a Set and back to an array.
const unique = [...new Set(items)];
Official JavaScript 2025 documentation
Was this page helpful?