js get amount of every unique element in an array code example
Example 1: how to find unique elements in array in javascript
let a = ["1", "1", "2", "3", "3", "1"];
let unique = a.filter((item, i, ar) => ar.indexOf(item) === i);
console.log(unique);
Example 2: unique values in array javascript
let uniqueItems = [...new Set(items)]