I am trying to get the unique category from the following array using loadsh,
[{
"listingId": "p106a904a-b8c6-4d2d-a364-0d21e3505010",
"section": "section1",
"category": "VIP PASS ",
"type": "paper",
"availableTickets": 1
}, {
"listingId": "p106904a-b8c6-4d2d-a364-0d21e3505010",
"section": "section1",
"category": "VIP PASS ",
"type": "paper",
"availableTickets": 2
}, {
"listingId": "pc8f54389-4e58-482a-9535-6917c2948764",
"section": "1",
"category": "WIP",
"type": "paper",
"availableTickets": 1
}]
This is what i have tried
this.categories = _.uniq(this.listings, function (test: ListDAO) { return test.category; });
but the above returns the same array again. how can i get the output result as,
VIP PASS and WIP