我有一个数组,其中包含不同状态的多个位置。
{"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"},..........
现在我可以为不同的状态创建一个没有重复状态的数组,比如
{"abc","xyz","def"}
但我想要的是在表格中按状态显示所有位置。
我怎样才能做到这一点??