关于在数组中排序多个值

有一个数组,其中有多个state。

{"location":"Lekki Phase 1","state":"abc","country":"Nigeria"},
{"location":"Lekki Phase 2","state":"xyz","country":"Nigeria"},
{"location":"Osapa London1","state":"def","country":"Nigeria"},
{"location":"Lekki Phase 2","state":"abc","country":"Nigeria"},
{"location":"Lekki Phase 3","state":"xyz","country":"Nigeria"},
{"location":"Osapa London 2","state":"def","country":"Nigeria"},..........

现在我可以做出一个没有重复的state数组。

{"abc","xyz","def"}

我想要在一个表显示所有的location state。

应该怎么实现?

遍历……,貌似我只能想到这种办法