Having a very large collection of objects structured like this:
[
{
"name": "john",
"job": "cop",
"city": "london"
},
{
"name": "mike",
"job": "nurse",
"city": "las vegas"
},
{
"name": "kate",
"job": "teacher",
"city": "london"
}
]
I'm trying to iterate through them in order of city. Pseudo-code:
For each city
print some extra city info
For each person in city
print person info
next
print some other extra city info
next
I know how to do this in a complicated way; is there a simple one using JQuery?
sortto sort it by city, then usejQuery.each()to iterate over them.