Hello - I've read a ton of stuff about deleting duplicate values in an array. They are all very useful - they just haven't addressed an array of objects.
Here's my array:
[HTML]
var sDat = [{
sid:12,
scode:"code",
sname:"Sam"
},
{
sid:12,
scode:"code",
sname:"Sam"
},
{
sid:139,
scode:"code",
sname:"Jake"
}];
[/HTML]
The array is produced from JSON sent to me from a database query. I can't do a "group by" in the sql query - i actually need the repeats in a different array.
Anyway - I want to be able to remove duplicate sDat.sid entries in my sDat array - but I'm having difficulties discovering a way to handle it.
Any ideas?
Here's my array:
[HTML]
var sDat = [{
sid:12,
scode:"code",
sname:"Sam"
},
{
sid:12,
scode:"code",
sname:"Sam"
},
{
sid:139,
scode:"code",
sname:"Jake"
}];
[/HTML]
The array is produced from JSON sent to me from a database query. I can't do a "group by" in the sql query - i actually need the repeats in a different array.
Anyway - I want to be able to remove duplicate sDat.sid entries in my sDat array - but I'm having difficulties discovering a way to handle it.
Any ideas?
Comment