##### Using a Set A [`Set`](https://www.javascripttutorial.net/es6/javascript-set/) is a collection of unique values. To remove duplicates from an array: - First, convert an array of duplicates to a `Set`. The new `Set` will implicitly remove duplicate elements. - Then, convert the `set` back to an array. ```js let chars = ['A', 'B', 'A', 'C', 'B']; let uniqueChars = [...new Set(chars)]; console.log(uniqueChars); //➞ ['A', 'B', 'C']; ``` ##### Using indexOf() and filter() The duplicate item is the item whose `indexOf()` value is different from its index value (since `indexOf()` finds the first instance) Filter out all where `indexOf()` matches index ```js let chars = ['A', 'B', 'A', 'C', 'B']; let uniqueChars = chars.filter((c, index) => { return chars.indexOf(c) === index; }); console.log(uniqueChars); //➞ ['A', 'B', 'C']; ``` ##### Using forEach() and include() The `include()` method returns `true` if an element is in an array or `false` if it is not. ```js let chars = ['A', 'B', 'A', 'C', 'B']; let uniqueChars = []; chars.forEach((c) => { if (!uniqueChars.includes(c)) { uniqueChars.push(c); } }); console.log(uniqueChars); //➞ ['A', 'B', 'C']; ```