javascript
Published on January 26, 2024By DeveloperBreeze
// Array with duplicate numbers
const numbers = [1, 2, 3, 4, 2, 5, 6, 1];
// Use Set to get unique elements and convert back to array
const uniqueNumbers = Array.from(new Set(numbers));
// Display the array without duplicates
console.log('Array without Duplicates:', uniqueNumbers);
Comments
Please log in to leave a comment.