I've been struggling with this over a few hours. The situation is, I have an app, that receives data about people in this JSON format:
"people": [
{
"name": "Ivan",
"city": "Moscow",
"country": "Russia"
},
{
"name": "John",
"city": "Seattle",
"country": "United States"
},
{
"name": "Michael",
"city": "Seattle",
"country": "United States"
}
]
And I need to filter them into groups based on their city (to be displayed in dropdown <ul>
s. I.e. user clicks "Seattle" and <li>
s with John and Michael are displayed.
How this can be done?