Basically I need some sort of library/set of functions that will allow me to perform advanced functions on arrays.
For example:
var jsondata = "SearchResponse":{ "Version":"2.0","Query":{
"SearchTerms":"sushi"},"Web":{ "Total":15000000,"Offset":0,"Results":[
{ "Title":"Sushi - Wikipedia, the free encyclopedia","Description":"In
Japanese cuisine, sushi (寿司, 鮨, 鮓, sushi?) is vinegared rice, usually
topped with other ingredients, including fish (cooked or uncooked) and
vegetables.","Url":"http:\/\/en.wikipedia.org\/wiki\/Sushi","DisplayUrl
":"http:\/\/en.wikipedia.org\/wiki\/Sushi","DateTime":"2008-06-
09T06:42:34Z"}]}} /* pageview_candidate */}
var filterdata = filter(jsondata, {"Title":"Sushi - Wikipedia, the free encyclopedia"});
And then filterdata will contain all results in jsondata that have the Title Sushi - Wikipedia, the free encyclopedia
Well, first of all,
jsondatais an Object, not an Array; however thejsondata.Web.Resultsproperty is an Array. With that in mind, you could make use of the JavaScript Array.filter method.If you want to do more serious work with Arrays then it would be sensible to include a Collections Framework; the most popular one for JavaScript is underscore.js. A solid understanding of Collections will pay off dividends in the future for your programming career.