Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Javascript Array/JSON Library [closed]

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

Answer*

Draft saved
Draft discarded
Cancel
1
  • Note that the native filter method is not available in IE < 9, that’s why underscore.js implements it where not natively available. Commented Aug 24, 2011 at 13:33

lang-js

AltStyle によって変換されたページ (->オリジナル) /