I'm looking for elegant way to implement unique key value set in javascript,
I have an object that looks like the following:
{
"name" : "admin",
"type" : "users",
"id" : "53cf50b32508adc39b0cc566"
},
{
"name" : "admin2",
"type" : "users",
"id" : "53cf50b32508adc39b0cc566"
}
i want to create array / set that will have id as the key and name,type as the values.
the set must be unique!
the result should by
array : [53cf50b32508adc39b0cc566 : {"name" : "admin2","type" : "users"}]
the id should appear only once
any suggestions?