I am using ajax to get a small set of data back from the server which returns JSON data with the following format:
{ \"data\": [ { \"
You could take a functional approach and use the Array.filter method:
var matchingResults = JSON['data'].filter(function(x){ return x.id == 2; }); // procede to use matching elements...