How can I get a list of unique values in an array? Do I always have to use a second array or is there something similar to java\'s hashmap in JavaScript?
I am going
With ES6 syntax
list = list.filter((x, i, a) => a.indexOf(x) === i)
x --> item in array i --> index of item a --> array reference, (in this case "list")
With ES5 syntax
list = list.filter(function (x, i, a) { return a.indexOf(x) === i; });
Browser Compatibility: IE9+