I have a json data like this below, how can I select the row of data by its id or by its email, etc?
[
Object { id="40", full_name="lau", email="kok@com", more...},
Object { id="39", full_name="Kok", email="lau@lauthiamkok.net", more...},
Object { id="5", full_name="Alice", email="alice@umbrellacorp.com", more...},
4 more...
]
if I do this,
console.log(app.contacts[0]);
I always get the first row only.
Can I use jquery.get()
to get a row from the list, something like this below?
console.log(app.contacts.get({id:5}));
You have to iterate and check the id or email property in the loop
FIDDLE
Also, the posted array / objects are not valid