Javascript Distinct Values From Array To Hashmap