Considering the performance as the first priority I suggest to query the JSON array and get the element required in two lines without looping through entire array.
Now the question is how to achieve that?
It’s very simple and easy, there are multiple libraries available which you may just have to include them in your project and follow the syntax.
As i said there are multiple libraries present but i prefer suggesting “JSLINQ” and “linq.js” which are easy to implement and open source plugins.
JSLINQ is the basic of all, It provides the ability to query (more like SQL) against arrays. This has minimum number of features and supports the basic queries.Download and Checkout the examples at
You can also check the different querying options available and edit them according to your requirement using an online editor present at
Let’s move on to linq.js which is used for many complicated situations like GroupJoin etc…
This library provides around 90 different type of querying options(mostly the ones supported in .NET 4.0). Using the library would be similar to JSLINQ whereas the syntax differs.
linq.js also supports short form syntax and if you’re someone who is looking for compatibility with C# or a library which allows jquery selections then linq.js would be the best option. You can download the source code from