The example code below demonstrates how to remove duplicate items from an array using JavaScript –

const duplicates = ['twc', 'hello', 'world', 'twc', 'world'];
const duplicatesRemoved = [...new Set(duplicates)];

Happy coding 🙂

Don’t forget to share!

Categorized in: