Working in jQuery or plain javascript
If i have an array of objects like so:
[
{"company":"acme", "Employees":10, "location":"Cork"},
{"company":"foo", "Employees":50, "location":"Limerick"},
{"company":"bar", "Employees":10, "location":"Dublin"}
{"company":"zanzo", "Employees":23, "location":"Dublin"}
]
is there a convenient way for me to query this data?
e.g. get all companies with over 20 employess, or get all companies located in Dublin
Thanks in advance
You could use the
.grep()function. For example:or: