In this tutorial you will learn how to get the unique values from inside an array in JavaScript. There are a few ways this can be done some of the most common ways are to use JavaScript array functions such as map and filter. But as of ES6 a object called Set was introduced which allows you to store a collection of unique value of any type.
const array = [ 'this', 'is', 'an', 'array', 'of', 'text', 'this', 'is', 'an', 'array', 'of', 'text',]; You can use the Set object to return the unique values of the array. export const unique = (values: Array