I have an array containing a few hundred object literals. Is there a way to query or match a specific one without having to loop through the entire array.
So for example, given:
var collection = [ { "id" : "A11", "text": "the text for A11", "data" : "12345" },
{ "id" : "B14", "text": "the text for B14", "data" : "16542" },
{ "id" : "C97", "text": "the text for C97", "data" : "54321" } ]
Is there a way to retrieve the item with "id" == "B14" without looping through the entire collection?