filter on array of in javascript unique code example
Example 1: unique values in array javascript
let uniqueItems = [...new Set(items)]
Example 2: Filtering an array for unique values
const my_array = [1, 2, 2, 3, 3, 4, 5, 5]
const unique_array = [...new Set(my_array)];
console.log(unique_array); // [1, 2, 3, 4, 5]