Possible Duplicate:
Array unique values
Get unique results from JSON array using jQuery
Im having a JSON string like this
[
Object { id="38",product="foo"},
Object { id="38",product="foo"},
Object { id="38",product="foo"},
Object { id="39",product="bar"},
Object { id="40",product="hello"},
Object { id="40",product="hello"}
]
There are duplicate values in this JSON array..how can i make this JSON array unique like this
[
Object { id="38",product="foo"},
Object { id="39",product="bar"},
Object { id="40",product="hello"}
]
.Im looking for a suggestion that uses less iterations,
Jquery $.inArray
is not working in this case.
Suggestion to use any third party libraries are welcome.