<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>jsinq Wiki &amp; Documentation Rss Feed</title><link>http://www.codeplex.com/jsinq/Wiki/View.aspx?title=Home</link><description>jsinq Wiki Rss Description</description><item><title>Updated Wiki: Frequently asked questions</title><link>http://jsinq.codeplex.com/wikipage?title=Frequently asked questions&amp;version=3</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;Q: How fast is JSINQ?&lt;/h2&gt;A: JSINQ&amp;#39;s &amp;quot;Enumerable&amp;quot; implementation is not optimized for speed, but it is still reasonably fast, i.e. for the kind of datasets you deal with in a typical JavaScript application, the performance of JSINQs &amp;quot;Enumerable&amp;quot; implementation should be more than adequate. JSINQs query-compiler on the other hand is relatively slow, but since queries are generally compiled once and then never again, the impact of the query compilation on the overall performance of a JavaScript application should again be negligible. If you run into performance problems when using JSINQ, make sure your queries are defined in a scope where they are not compiled over and over again.&lt;br /&gt;
&lt;h2&gt;Q: Is JSINQ ready for production use?&lt;/h2&gt;A: Yes, for the most part! The &amp;quot;Enumerable&amp;quot; part of JSINQ is reasonably well-tested and is generally considered to be &amp;quot;safe&amp;quot; but the query compiler is still in a rather &amp;quot;experimental&amp;quot; stage. What you should note though is that if the query compiler produces correct output for a specific query, it is very likely to continue to do so in the future. In other words: bugs in the query compiler are likely to show up early and if a query compiles without errors once, it will not fail the second time (barring the influence of cosmic rays).&lt;br /&gt;
&lt;h2&gt;Q: Is JSINQ prone to &amp;quot;SQL injections&amp;quot;?&lt;/h2&gt;A: You mean JSINQ-injections? Yes it is, but &lt;b&gt;only if you are doing it wrong&lt;/b&gt;! Since you specify your queries as strings, they are &lt;i&gt;theoretically&lt;/i&gt; prone to the same kind of injection-type attacks that you get with SQL, &lt;b&gt;but&lt;/b&gt; only if you are piecing together your queries with unvalidated strings that you somehow obtain from the user. Of course that is absolutely not how you should write your queries. If you have to get variables into your query, &lt;b&gt;use placeholders&lt;/b&gt;! Placeholders are not replaced textually, i.e. you can&amp;#39;t hijack a JSINQ query using a bad string passed in via a placeholder. Also, since JSINQ runs on the client, even if it was prone to injection-type attacks, it wouldn&amp;#39;t really matter because &lt;b&gt;you should never trust anything that comes from the client, ever&lt;/b&gt;.&lt;br /&gt;
&lt;h2&gt;Q: Is JSINQ better than jQuery, Prototype,...?&lt;/h2&gt;A: No. JSINQ is not a general-purpose JavaScript framework, it is not a widget library, it is not an Ajax framework and it doesn&amp;#39;t try to be any of those things. You can easily combine JSINQ with those frameworks though.&lt;br /&gt;
&lt;h2&gt;Q: Does JSINQ support nested queries?&lt;/h2&gt;A: Theoretically: yes. You can assign query objects to placeholders or you can even define nested queries inline using anonymous functions.&lt;br /&gt;
&lt;h2&gt;Q: What does JSINQ stand for?&lt;/h2&gt;A: &lt;u&gt;J&lt;/u&gt;ava&lt;u&gt;S&lt;/u&gt;cript &lt;u&gt;IN&lt;/u&gt;tegrated &lt;u&gt;Q&lt;/u&gt;uery. And yes, it&amp;#39;s a misnomer because JSINQ isn&amp;#39;t really integrated into JavaScript at all.&lt;br /&gt;
&lt;h2&gt;Q: Is there a &amp;quot;JSINQ to XML&amp;quot;?&lt;/h2&gt;A: If by that you mean a JavaScript equivalent of LINQ to XML, then no. But there should be and you should probably be the one to write it (let me know if you do).&lt;br /&gt;
&lt;h2&gt;Q: How do you pronounce JSINQ?&lt;/h2&gt;A: I pronounce it Jay-Sink, but you may also pronounce it Jay-Ess-Ink or Ja-Zink (the sound a broken cash register makes).&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Wed, 04 Aug 2010 06:50:49 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Frequently asked questions 20100804065049A</guid></item><item><title>Updated Wiki: Home</title><link>http://jsinq.codeplex.com/wikipage?version=20</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;JSINQ 1.0 out now!&lt;/h2&gt;JSINQ 1.0, the first &lt;b&gt;stable release&lt;/b&gt; of JSINQ is available for download right now! It is packed with new features such as
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Support for all .NET 3.5 query operators&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Experimental support for the &lt;b&gt;.NET 4.0 query operator &amp;quot;zip&amp;quot;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;100% lazy&lt;/b&gt; (uses deferred execution)&lt;/li&gt;
&lt;li&gt;Complete, fully tested &lt;b&gt;implementations of System.Collections.Generic.List&lt;/b&gt; and &lt;b&gt;System.Collections.Generic.Dictionary&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;toList, toDictionary and toLookup&lt;/b&gt; now available for jsinq.Enumerable&lt;/li&gt;
&lt;li&gt;Still &lt;b&gt;only 23 KB when minified&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://kaijaeger.com/downloads/jsinq/playground/" class="externalLink"&gt;Try it yourself online!&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;Get started with JSINQ&amp;#33;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/documentation?referringTitle=Home"&gt;Read the documentation&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;What is JSINQ?&lt;/h2&gt;&lt;b&gt;JSINQ is the JavaScript library that allows you to write SQL-like queries against arrays and DOM node lists.&lt;/b&gt;&lt;br /&gt;JSINQ is a complete implementation of LINQ to Objects (the .NET 4.0 version) in JavaScript. What that means is that if you know LINQ and you know JavaScript, you know JSINQ. JSINQ is both an API-compatible implementation of System.Linq.Enumerable and a complete query-expression compiler. That&amp;#39;s right: &lt;i&gt;you can write LINQ-style queries in JavaScript&lt;/i&gt;. And if that isn&amp;#39;t enough: JSINQ is also very liberally licensed, well-document, well-tested (the Enumerable-part) and &lt;b&gt;a stable version has just been released&lt;/b&gt;. So give it a go!&lt;br /&gt;
&lt;h2&gt;What does it look like?&lt;/h2&gt;Let&amp;#39;s say you have a list of &lt;i&gt;customers&lt;/i&gt; and you want to assemble a list of your customers&amp;#39; lastnames, ordered by their frequency. With JSINQ, you can write something like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; result = 
    customers.groupBy(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(customer) { 
        &lt;span style="color:Blue;"&gt;return&lt;/span&gt; customer.lastname; 
    }).
    select(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(g) { 
        &lt;span style="color:Blue;"&gt;return&lt;/span&gt; {lastname: g.key, count: g.count()}; 
    }).
    orderByDescending(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(r) { 
        &lt;span style="color:Blue;"&gt;return&lt;/span&gt; r.count; 
    });
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;This will do the job, but it&amp;#39;s also rather difficult to read. That&amp;#39;s why JSINQ also lets you write the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&amp;#39;\
    from customer &lt;span style="color:Blue;"&gt;in&lt;/span&gt; $0 \
    group customer by customer.lastname into g \
    select {lastname: g.key, count: g.count()} \
    into r \
    orderby r.count descending \
    select r \
&amp;#39;);

query.setValue(0, customers);
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; result = query.execute();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Confused? What&amp;#39;s with all the backslashes?&lt;/b&gt; Please read: &lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;JSINQ in a nutshell&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;What can I do with JSINQ?&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Write arbitrarily complex queries against JavaScript arrays, DOM node lists or your own enumerable types&lt;/li&gt;
&lt;li&gt;Find elements in the HTML DOM tree using SQL-like queries&lt;/li&gt;
&lt;li&gt;Dynamically create HTML elements from JSON you have received via XMLHttpRequest in a declarative manner&lt;/li&gt;
&lt;li&gt;Tinker with XML and turn it into something else&lt;/li&gt;
&lt;li&gt;Combine it in interesting ways with the JavaScript-/Ajax-frameworks you are already using&lt;/li&gt;
&lt;li&gt;Write less code by exploiting the power of declarative programming&lt;/li&gt;
&lt;li&gt;And for the ambitious: write &lt;a href="http://blogs.msdn.com/lukeh/archive/2007/10/01/taking-linq-to-objects-to-extremes-a-fully-linqified-raytracer.aspx" class="externalLink"&gt;raytracers&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/lukeh/archive/2007/08/19/monadic-parser-combinators-using-c-3-0.aspx" class="externalLink"&gt;monadic parser combinators&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, etc.&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Using JSINQ&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;JSINQ in a nutshell&lt;/a&gt;&lt;/b&gt; (new to JSINQ?, read this!)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/documentation?referringTitle=Home"&gt;JSINQ Documentation&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=Frequently%20asked%20questions&amp;referringTitle=Home"&gt;Frequently asked questions&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Previous work&lt;/h2&gt;JSINQ isn&amp;#39;t the first attempt at implementing LINQ in JavaScript. There is also Chris Pietschmann&amp;#39;s &lt;a href="http://www.codeplex.com/JSLINQ" class="externalLink"&gt;LINQ to JavaScript&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; (right here on CodePlex), there is &lt;a href="http://plugins.jquery.com/project/jLINQ" class="externalLink"&gt;jLINQ&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and then there is &lt;a href="http://netindonesia.net/blogs/jimmy/archive/2007/07/16/Javascript-LINQ_3F003F003F00_.aspx" class="externalLink"&gt;this&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Wed, 04 Aug 2010 06:49:38 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20100804064938A</guid></item><item><title>Updated Wiki: Home</title><link>http://jsinq.codeplex.com/wikipage?version=19</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;JSINQ 1.0 out now!&lt;/h2&gt;JSINQ 1.0, the first &lt;b&gt;stable release&lt;/b&gt; of JSINQ is available for download right now! It is packed with new features such as
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Support for all .NET 3.5 query operators&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Experimental support for the &lt;b&gt;.NET 4.0 query operator &amp;quot;zip&amp;quot;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;100% lazy&lt;/b&gt; (uses deferred execution)&lt;/li&gt;
&lt;li&gt;Complete, fully tested &lt;b&gt;implementations of System.Collections.Generic.List&lt;/b&gt; and &lt;b&gt;System.Collections.Generic.Dictionary&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;toList, toDictionary and toLookup&lt;/b&gt; now available for jsinq.Enumerable&lt;/li&gt;
&lt;li&gt;Still &lt;b&gt;only 23 KB when minified&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://kaijaeger.com/downloads/jsinq/playground/" class="externalLink"&gt;Try it yourself online!&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;Get started with JSINQ&amp;#33;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/documentation?referringTitle=Home"&gt;Read the documentation&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;What is JSINQ?&lt;/h2&gt;&lt;b&gt;JSINQ is the JavaScript library that allows you to write SQL-like queries against arrays and DOM node lists.&lt;/b&gt;&lt;br /&gt;JSINQ is a complete implementation of LINQ to Objects (the .NET 4.0 version) in JavaScript. What that means is that if you know LINQ and you know JavaScript, you know JSINQ. JSINQ is both an API-compatible implementation of System.Linq.Enumerable and a complete query-expression compiler. That&amp;#39;s right: &lt;i&gt;you can write LINQ-style queries in JavaScript&lt;/i&gt;. And if that isn&amp;#39;t enough: JSINQ is also very liberally licensed, well-document, well-tested (the Enumerable-part) and &lt;b&gt;a stable version has just been released&lt;/b&gt;. So give it a go!&lt;br /&gt;
&lt;h2&gt;What does it look like?&lt;/h2&gt;Let&amp;#39;s say you have a list of &lt;i&gt;customers&lt;/i&gt; and you want to assemble a list of your customers&amp;#39; lastnames, ordered by their frequency. With JSINQ, you can write something like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; result = 
    customers.groupBy(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(customer) { 
        &lt;span style="color:Blue;"&gt;return&lt;/span&gt; customer.lastname; 
    }).
    select(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(g) { 
        &lt;span style="color:Blue;"&gt;return&lt;/span&gt; {lastname: g.key, count: g.count()}; 
    }).
    orderByDescending(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(r) { 
        &lt;span style="color:Blue;"&gt;return&lt;/span&gt; r.count; 
    }).
    select(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(r) { 
        &lt;span style="color:Blue;"&gt;return&lt;/span&gt; r; 
    });
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;This will do the job, but it&amp;#39;s also rather difficult to read. That&amp;#39;s why JSINQ also lets you write the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&amp;#39;\
    from customer &lt;span style="color:Blue;"&gt;in&lt;/span&gt; $0 \
    group customer by customer.lastname into g \
    select {lastname: g.key, count: g.count()} \
    into r \
    orderby r.count descending \
    select r \
&amp;#39;);

query.setValue(0, customers);
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; result = query.execute();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Confused? What&amp;#39;s with all the backslashes?&lt;/b&gt; Please read: &lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;JSINQ in a nutshell&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;What can I do with JSINQ?&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Write arbitrarily complex queries against JavaScript arrays, DOM node lists or your own enumerable types&lt;/li&gt;
&lt;li&gt;Find elements in the HTML DOM tree using SQL-like queries&lt;/li&gt;
&lt;li&gt;Dynamically create HTML elements from JSON you have received via XMLHttpRequest in a declarative manner&lt;/li&gt;
&lt;li&gt;Tinker with XML and turn it into something else&lt;/li&gt;
&lt;li&gt;Combine it in interesting ways with the JavaScript-/Ajax-frameworks you are already using&lt;/li&gt;
&lt;li&gt;Write less code by exploiting the power of declarative programming&lt;/li&gt;
&lt;li&gt;And for the ambitious: write &lt;a href="http://blogs.msdn.com/lukeh/archive/2007/10/01/taking-linq-to-objects-to-extremes-a-fully-linqified-raytracer.aspx" class="externalLink"&gt;raytracers&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/lukeh/archive/2007/08/19/monadic-parser-combinators-using-c-3-0.aspx" class="externalLink"&gt;monadic parser combinators&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, etc.&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Using JSINQ&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;JSINQ in a nutshell&lt;/a&gt;&lt;/b&gt; (new to JSINQ?, read this!)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/documentation?referringTitle=Home"&gt;JSING Documentation&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=Frequently%20asked%20questions&amp;referringTitle=Home"&gt;Frequently asked questions&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Previous work&lt;/h2&gt;JSINQ isn&amp;#39;t the first attempt at implementing LINQ in JavaScript. There is also Chris Pietschmann&amp;#39;s &lt;a href="http://www.codeplex.com/JSLINQ" class="externalLink"&gt;LINQ to JavaScript&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; (right here on CodePlex), there is &lt;a href="http://plugins.jquery.com/project/jLINQ" class="externalLink"&gt;jLINQ&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and then there is &lt;a href="http://netindonesia.net/blogs/jimmy/archive/2007/07/16/Javascript-LINQ_3F003F003F00_.aspx" class="externalLink"&gt;this&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Mon, 24 May 2010 09:06:37 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20100524090637A</guid></item><item><title>Updated Wiki: Home</title><link>http://jsinq.codeplex.com/wikipage?version=18</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;JSINQ 1.0 out now!&lt;/h2&gt;JSINQ 1.0, the first &lt;b&gt;stable release&lt;/b&gt; of JSINQ is available for download right now! It is packed with new features such as
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Support for all .NET 3.5 query operators&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Experimental support for the &lt;b&gt;.NET 4.0 query operator &amp;quot;zip&amp;quot;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Complete, fully tested &lt;b&gt;implementations of System.Collections.Generic.List&lt;/b&gt; and &lt;b&gt;System.Collections.Generic.Dictionary&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;toList, toDictionary and toLookup&lt;/b&gt; now available for jsinq.Enumerable&lt;/li&gt;
&lt;li&gt;Still &lt;b&gt;only 23 KB when minified&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://kaijaeger.com/downloads/jsinq/playground/" class="externalLink"&gt;Try it yourself online!&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;Get started with JSINQ&amp;#33;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/documentation?referringTitle=Home"&gt;Read the documentation&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;What is JSINQ?&lt;/h2&gt;&lt;b&gt;JSINQ is the JavaScript library that allows you to write SQL-like queries against arrays and DOM node lists.&lt;/b&gt;&lt;br /&gt;JSINQ is a complete implementation of LINQ to Objects (the .NET 4.0 version) in JavaScript. What that means is that if you know LINQ and you know JavaScript, you know JSINQ. JSINQ is both an API-compatible implementation of System.Linq.Enumerable and a complete query-expression compiler. That&amp;#39;s right: &lt;i&gt;you can write LINQ-style queries in JavaScript&lt;/i&gt;. And if that isn&amp;#39;t enough: JSINQ is also very liberally licensed, well-document, well-tested (the Enumerable-part) and &lt;b&gt;a stable version has just been released&lt;/b&gt;. So give it a go!&lt;br /&gt;
&lt;h2&gt;What does it look like?&lt;/h2&gt;Let&amp;#39;s say you have a list of &lt;i&gt;customers&lt;/i&gt; and you want to assemble a list of your customers&amp;#39; lastnames, ordered by their frequency. With JSINQ, you can write something like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; result = 
    customers.groupBy(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(customer) { 
        &lt;span style="color:Blue;"&gt;return&lt;/span&gt; customer.lastname; 
    }).
    select(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(g) { 
        &lt;span style="color:Blue;"&gt;return&lt;/span&gt; {lastname: g.key, count: g.count()}; 
    }).
    orderByDescending(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(r) { 
        &lt;span style="color:Blue;"&gt;return&lt;/span&gt; r.count; 
    }).
    select(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(r) { 
        &lt;span style="color:Blue;"&gt;return&lt;/span&gt; r; 
    });
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;This will do the job, but it&amp;#39;s also rather difficult to read. That&amp;#39;s why JSINQ also lets you write the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&amp;#39;\
    from customer &lt;span style="color:Blue;"&gt;in&lt;/span&gt; $0 \
    group customer by customer.lastname into g \
    select {lastname: g.key, count: g.count()} \
    into r \
    orderby r.count descending \
    select r \
&amp;#39;);

query.setValue(0, customers);
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; result = query.execute();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Confused? What&amp;#39;s with all the backslashes?&lt;/b&gt; Please read: &lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;JSINQ in a nutshell&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;What can I do with JSINQ?&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Write arbitrarily complex queries against JavaScript arrays, DOM node lists or your own enumerable types&lt;/li&gt;
&lt;li&gt;Find elements in the HTML DOM tree using SQL-like queries&lt;/li&gt;
&lt;li&gt;Dynamically create HTML elements from JSON you have received via XMLHttpRequest in a declarative manner&lt;/li&gt;
&lt;li&gt;Tinker with XML and turn it into something else&lt;/li&gt;
&lt;li&gt;Combine it in interesting ways with the JavaScript-/Ajax-frameworks you are already using&lt;/li&gt;
&lt;li&gt;Write less code by exploiting the power of declarative programming&lt;/li&gt;
&lt;li&gt;And for the ambitious: write &lt;a href="http://blogs.msdn.com/lukeh/archive/2007/10/01/taking-linq-to-objects-to-extremes-a-fully-linqified-raytracer.aspx" class="externalLink"&gt;raytracers&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/lukeh/archive/2007/08/19/monadic-parser-combinators-using-c-3-0.aspx" class="externalLink"&gt;monadic parser combinators&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, etc.&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Using JSINQ&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;JSINQ in a nutshell&lt;/a&gt;&lt;/b&gt; (new to JSINQ?, read this!)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/documentation?referringTitle=Home"&gt;JSING Documentation&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=Frequently%20asked%20questions&amp;referringTitle=Home"&gt;Frequently asked questions&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Previous work&lt;/h2&gt;JSINQ isn&amp;#39;t the first attempt at implementing LINQ in JavaScript. There is also Chris Pietschmann&amp;#39;s &lt;a href="http://www.codeplex.com/JSLINQ" class="externalLink"&gt;LINQ to JavaScript&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; (right here on CodePlex), there is &lt;a href="http://plugins.jquery.com/project/jLINQ" class="externalLink"&gt;jLINQ&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and then there is &lt;a href="http://netindonesia.net/blogs/jimmy/archive/2007/07/16/Javascript-LINQ_3F003F003F00_.aspx" class="externalLink"&gt;this&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Thu, 13 May 2010 09:41:26 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20100513094126A</guid></item><item><title>Updated Wiki: JSINQ in a nutshell</title><link>http://jsinq.codeplex.com/wikipage?title=JSINQ in a nutshell&amp;version=7</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;Including the JSINQ files&lt;/h2&gt;JSINQ consists of two components, jsinq.Enumerable and jsinq.Query. The &amp;quot;Enumerable&amp;quot; component is a complete, API-compatible implementation of the .NET class &lt;a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable_members.aspx" class="externalLink"&gt;System.Linq.Enumerable&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. To use jsinq.Enumerable, you need to include the &amp;quot;jsinq.js&amp;quot; file in your HTML page like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&amp;lt;script type=&lt;span style="color:#A31515;"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; src=&lt;span style="color:#A31515;"&gt;&amp;quot;jsinq.js&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;It is recommended that you use the file found in the &amp;quot;build&amp;quot; folder as it is substantially smaller than the un-minified file found in the &amp;quot;source&amp;quot; folder.&lt;br /&gt;&lt;br /&gt;If you also want to use jsinq.Query (see below), you&amp;#39;ll also have to include the file &amp;quot;jsinq-query.js&amp;quot;.&lt;br /&gt;
&lt;h2&gt;Writing queries using query-methods&lt;/h2&gt;Once you have included the file(s), you can start to write queries against arrays, DOM node lists or your own enumerable objects. An example:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; names = [&lt;span style="color:#A31515;"&gt;&amp;#39;Bob&amp;#39;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;#39;Alice&amp;#39;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;#39;Joe&amp;#39;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;#39;Frank&amp;#39;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;#39;Arthur&amp;#39;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;#39;Marcy&amp;#39;&lt;/span&gt;];
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; enumerable = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Enumerable(names);

&lt;span style="color:Blue;"&gt;var&lt;/span&gt; namesThatStartWithAnA = enumerable.where(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(name) { 
	&lt;span style="color:Blue;"&gt;return&lt;/span&gt; name.charAt(0) == &lt;span style="color:#A31515;"&gt;&amp;#39;A&amp;#39;&lt;/span&gt;; 
});
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;The variable &amp;quot;namesThatStartWithAnA&amp;quot; now refers to an enumerable that will return all the names in the &amp;quot;names&amp;quot; array that start with a capital &amp;quot;A&amp;quot; when enumerated. To enumerate an enumerable, do the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; enumerator = namesThatStartWithAnA.getEnumerator();
&lt;span style="color:Blue;"&gt;while&lt;/span&gt; (enumerator.moveNext()) {
	&lt;span style="color:Blue;"&gt;var&lt;/span&gt; name = enumerator.current();
	document.write(name + &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;lt;br /&amp;gt;&amp;#39;&lt;/span&gt;);
}
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;There is also a convenient helper-method that makes enumerating over the elements in an enumerable much easier:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
namesThatStartWithAnA.each(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(name) {
	document.write(name + &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;lt;br /&amp;gt;&amp;#39;&lt;/span&gt;);
});
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You can create more complex queries by chaining together multiple query-methods like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; result = enumerable.where(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(name) { 
	&lt;span style="color:Blue;"&gt;return&lt;/span&gt; name.toLowerCase().indexOf(&lt;span style="color:#A31515;"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;) &amp;gt; -1; 
}).orderByDescending(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(name) { 
	&lt;span style="color:Blue;"&gt;return&lt;/span&gt; name; 
});
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;When enumerating the enumerator referred to by the variable &amp;quot;result&amp;quot;, you will receive a list of all names that contain an &amp;quot;a&amp;quot; in a reverse alphabetical order.&lt;br /&gt;&lt;br /&gt;Using this &amp;quot;pattern&amp;quot;, you can create arbitrarily complex queries. Unfortunately, the simple query above already looks quite complex and as you keep adding clauses to your query, it will become increasingly difficult to see what the result of a query is going to be. &lt;br /&gt;
&lt;h2&gt;Writing queries using query expressions&lt;/h2&gt;Fortunately, chaining together query-methods is not the only way of defining a query in JSINQ. Instead, you can write your queries in a more natural, SQL-like fashion:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&amp;#39; \
	from name &lt;span style="color:Blue;"&gt;in&lt;/span&gt; $0 \
	where name.toLowerCase().indexOf(&lt;span style="color:#A31515;"&gt;&amp;quot;a&amp;quot;&lt;/span&gt;) &amp;gt; -1 \
	orderby name descending \
	select name \
&amp;#39;);
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;So what is going on here? The Query constructor provided by JSINQ receives a string containing a LINQ expression and essentially compiles it into JavaScript code. Unsurprisingly, the JavaScript code produced by the query compiler looks exactly like the code in the previous examples. Looking at the code above however, you might notice two things that are weird. For one, what is up with all the backslashes? JavaScript does not officially support multi-line strings which is a bummer, because queries look so much nicer when you put each clause on a separate line. Multi-line strings can however be simulated by placing a backslash at the end of each line. This is slightly evil because it is not in any way mentioned in the JavaScript language specification, but it appears to work in most browsers (read: use with caution and at your own risk). Secondly, what is &amp;quot;$0&amp;quot;? The JSINQ Query object essentially acts like a prepared statement. When you create a new Query object, you invoke the query compiler but the query is not actually executed. That way, you can use the same query many times without having to re-compile it over and over again. What&amp;#39;s even better is, that you can apply the same query to different datasets without having to re-compile it. This is where placeholders come into play. You can use placeholders in your query, where you would otherwise use an identifier or an expression. Using the &amp;quot;setValue&amp;quot; method of the Query object, you can then assign a concrete value to each placeholder like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
query.setValue(0, enumerable);
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;This assigns our enumerable (the one with the names in it) to placeholder &amp;quot;$0&amp;quot;. Once you have assigned a value to each placeholder, you can execute a query by invoking its &amp;quot;execute&amp;quot; method. Our example in its entirety now looks like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&amp;#39; \
	from name &lt;span style="color:Blue;"&gt;in&lt;/span&gt; $0 \
	where name.toLowerCase().indexOf(&lt;span style="color:#A31515;"&gt;&amp;quot;a&amp;quot;&lt;/span&gt;) &amp;gt; -1 \
	orderby name descending \
	select name \
&amp;#39;);

query.setValue(0, enumerable);
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; result = query.execute();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;The variable &amp;quot;result&amp;quot; now contains the enumerable that is the result of applying our query to the enumerable that we have specified using the &amp;quot;setValue&amp;quot; method.&lt;br /&gt;
&lt;h2&gt;What&amp;#39;s next?&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Download JSINQ!&lt;/li&gt;
&lt;li&gt;Read the &lt;a href="http://jsinq.codeplex.com/documentation?referringTitle=JSINQ%20in%20a%20nutshell"&gt;documentation&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:17:08 GMT</pubDate><guid isPermaLink="false">Updated Wiki: JSINQ in a nutshell 20100327021708P</guid></item><item><title>Updated Wiki: jsinq.Dictionary</title><link>http://jsinq.codeplex.com/wikipage?title=jsinq.Dictionary&amp;version=2</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;jsinq.Dictionary&lt;/h2&gt;
Since its initial release, JSINQ has been expanded to also contain the two collection classes jsinq.List and jsinq.Dictionary. jsinq.Dictionary is a complete implementation of System.Collections.Generic.Dictionary. Unlike JavaScript&amp;#39;s object type, jsinq.Dictionary supports arbitrary values as keys. &lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; dictionary = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Dictionary();
dictionary.set(&lt;span style="color:#A31515;"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;quot;World&amp;quot;&lt;/span&gt;);
alert(dictionary.item(&lt;span style="color:#A31515;"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;)); &lt;span style="color:Green;"&gt;// alerts &amp;quot;World&amp;quot;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; myKey = { foo: 123 };
dictionary.set(myKey, &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Date());
alert(dictionary.containsKey(myKey)); &lt;span style="color:Green;"&gt;// alerts &amp;quot;true&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You can also turn any jsinq.Enumerable into a dictionary by invoking its &amp;quot;toDictionary&amp;quot; method.&lt;br /&gt;
&lt;h3&gt;Methods&lt;/h3&gt;jsinq.Dictionary provides the following methods:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Method &lt;/th&gt;&lt;th&gt; Static &lt;/th&gt;&lt;th&gt; Description &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; item &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Retrieves the value associated with the specified key  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; set &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Sets the value associated with the specified key. An existing value associated with the key will be replaced. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; count &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the number of key-value pairs in this dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; getComparer &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Retrieves the comparer associated with this dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; add &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Adds the specified key and value to the dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; tryAdd &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Attempts to add the specified key and value to the dictionary. Returns a boolean value indicating whether the operation was successful. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; keys &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an array containing the keys in this dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; values &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an array containing the values in this dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; clear &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Empties the dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; containsKey &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a boolean value indicating whether the specified key is contained within the dictionary. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; containsValue &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a boolean value indicating whether the specified value is contained within the dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; getEnumerator &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an enumerator that iterates over this dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toArray &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an array containing the keys and values in this dictionary dictionary. Returns a boolean value indicating whether the operation was successful. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; isReadOnly &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Indicates whether this dictionary is read-only &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toString &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a string representing the dictionary &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Please check out the official .NET reference for additional information on how to use these methods: &lt;a href="http://msdn.microsoft.com/en-us/library/xfhwa508.aspx" class="externalLink"&gt;http://msdn.microsoft.com/en-us/library/xfhwa508.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;Also look at the comments in the source code and of course the examples.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:16:27 GMT</pubDate><guid isPermaLink="false">Updated Wiki: jsinq.Dictionary 20100327021627P</guid></item><item><title>Updated Wiki: jsinq.List</title><link>http://jsinq.codeplex.com/wikipage?title=jsinq.List&amp;version=3</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;jsinq.List&lt;/h2&gt;
As of version 1.0, JSINQ contains a complete implementation of System.Collections.Generic.List that you can use independently of the querying functionality. To use JSINQ&amp;#39;s list implementation, all you have to do is include the file &amp;quot;jsinq.js&amp;quot;. You can then use jsinq.List like you would System.Collections.Generic.List:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; list = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.List();
list.add(&lt;span style="color:#A31515;"&gt;&amp;quot;JSINQ&amp;quot;&lt;/span&gt;);
list.insert(0, &lt;span style="color:#A31515;"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;);
list.removeAt(1);
alert(list.item(0);
list.set(0, &lt;span style="color:#A31515;"&gt;&amp;quot;Test&amp;quot;&lt;/span&gt;);
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You can also turn any jsinq.Enumerable into a list by invoking its &amp;quot;toList&amp;quot; method.&lt;br /&gt;
&lt;h3&gt;Methods&lt;/h3&gt;jsinq.List provides the following methods:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Method &lt;/th&gt;&lt;th&gt; Static &lt;/th&gt;&lt;th&gt; Description &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; add &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Adds the specified item to the end of the list  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; item &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Retrieves the element at the specified index  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; set &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Sets the element at the specified index  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; addRange &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Adds the elements of the specified collection to the end of the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; asReadOnly &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Return a read-only list wrapper for the current collection &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; binarySearch &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Searches a sorted list for the given element &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; clear &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Empties the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; copyTo &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Copies a range of elements from the list to the specified array &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; exists &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a boolean value indicating whether the list contains any elements satisfying the condition defined by the given predicate function &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; find &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the first occurrence of an element that satisfies the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; findAll &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Retrieves all the elements from the list that satisfy the condtion defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; findIndex &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the index of the first element in the list that satisfies the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; findLast &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the last occurrence of an element that satisfies the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; findLastIndex &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the index of the last element in the list that satisfies the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; forEach &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Performs the specified action for each element in the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; getEnumerator &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an enumerator that iterates through the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; getRange &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Extracts a range of elements from the list. The operation performs a shallow copy of the extracted elements, i.e. reference types are not cloned. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; indexOf &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the index of the first occurrence of the specified item in the list or a part thereof &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; insert &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Inserts the specified element into the list at the specified position &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; insertRange &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Inserts the elements in the specified collection into the list at the specified position &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; lastIndexOf &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the index of the last occurrence of the specified item in the list or a part thereof &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; remove &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Removes the specified item from the list. Returns a boolean value indicating whether the operation was successful &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; removeAll &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Removes all the elements from the list that satisfy the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; removeAt &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Removes the element at the given index from the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; removeRange &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Removes a range of elements from the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; reverse &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Reverses the order of the elements in the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; sort &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Sorts the elements in the list or a portion thereof &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toArray &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an array containing the elements in the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toString &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a string representing the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; isReadOnly &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Indicates whether this list is read-only &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; trueForAll &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns true if all elements in the list satisfy the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Please check out the official .NET reference for additional information on how to use these methods: &lt;a href="http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx" class="externalLink"&gt;http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;Also look at the comments in the source code and of course the examples.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:16:18 GMT</pubDate><guid isPermaLink="false">Updated Wiki: jsinq.List 20100327021618P</guid></item><item><title>Updated Wiki: jsinq.Query</title><link>http://jsinq.codeplex.com/wikipage?title=jsinq.Query&amp;version=2</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;jsinq.Query&lt;/h2&gt;jsinq.Query is where the magic happens, that is where LINQ-style queries are turned into JavaScript code. jsinq.Query depends on jsinq.Enumerable, so make sure you include both files when using the query-expression capabilities of JSINQ. &lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&lt;span style="color:#A31515;"&gt;&amp;quot;from customer in $0 where customer.lastname.charAt(&amp;#39;0&amp;#39;) == &amp;#39;S&amp;#39; select customer.lastname&amp;quot;&lt;/span&gt;);
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;This is how you create a new Query. The Query constructor receives the string that contains the query, leaving you with a Query object that is (almost) ready to use. If there is a syntactical error in your query, the query compiler will catch it and throw a &lt;b&gt;QueryTranslationException&lt;/b&gt;. Inspect the exception object to see the error message, line number and character offset at which the error occurred. Note that (for now), the error messages produced by the query compiler are pretty bad and the line number given in the exception object is often nowhere near where the actual error occurred. Also note that the query compiler will catch errors in expressions that may be part of the query, so make sure you check those as well.&lt;br /&gt;&lt;br /&gt;A query object essentially is a prepared statement, similar to those you might know from writing database applications. That means that a query object is a query waiting to be executed. Before you can do that however, you have to assign values to all placeholders that may exist in your query. Since queries are specified as strings, they are slightly detached from their surroundings and they cannot access variables from &amp;quot;the outside world&amp;quot;. This may seem like a problem, but it really isn&amp;#39;t. Where you would normally use variables, you can instead use placeholders. These are composed of a dollar sign and a number (like this: &lt;b&gt;$0&lt;/b&gt;) which makes them easy to distinguish from &amp;quot;real&amp;quot; variables. To assign a value to a placeholder, you use the &lt;i&gt;setValue&lt;/i&gt; method like so:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&lt;span style="color:#A31515;"&gt;&amp;quot;from customer in $0 where customer.lastname.charAt(&amp;#39;0&amp;#39;) == &amp;#39;S&amp;#39; select customer.lastname&amp;quot;&lt;/span&gt;);
query.setValue(0, myCustomers);
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;The nice thing about placeholders is that you can keep assigning different values to them as often as you like. So you can use the same query over and over again but have it work on different datasets, with different constraints and so forth.&lt;br /&gt;&lt;br /&gt;After you have assigned values to all placeholders, you call the &lt;i&gt;execute&lt;/i&gt; method. The execute method executes the query and returns its result (which generally is an Enumerable):&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&lt;span style="color:#A31515;"&gt;&amp;#39;from customer in $0 where customer.lastname.charAt(&amp;#39;&lt;/span&gt;0&lt;span style="color:#A31515;"&gt;&amp;#39;) == &amp;#39;&lt;/span&gt;S&lt;span style="color:#A31515;"&gt;&amp;#39; select customer.lastname&amp;#39;&lt;/span&gt;);
query.setValue(0, myCustomers);
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; filterCustomers = query.execute();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;And that is all there is to writing queries! If you are new to LINQ and are not familiar with the query expression syntax, check out these examples: &lt;a href="http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx" class="externalLink"&gt;http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; (note that some of these are a little outdated and the syntax has since changed a little).&lt;br /&gt;
&lt;h3&gt;Spanning queries across multiple lines&lt;/h3&gt;The most common way of formatting a LINQ query is to put each clause on its own line like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
from c in customers
join o in orders on c.id equals o.customerId
where o.items &amp;gt; 10
orderby c.lastname
select {lastname: c.lastname, items: o.items} &lt;/pre&gt;&lt;br /&gt;Unfortunately, JavaScript does not natively support multi-line strings. So you&amp;#39;re stuck with writing something like this: &lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:#A31515;"&gt;&amp;quot;from c in customers&amp;quot;&lt;/span&gt; +
    &lt;span style="color:#A31515;"&gt;&amp;quot;join o in orders on c.id equals o.customerId&amp;quot;&lt;/span&gt; +
    &lt;span style="color:#A31515;"&gt;&amp;quot;where o.items &amp;gt; 10&amp;quot;&lt;/span&gt; +
    &lt;span style="color:#A31515;"&gt;&amp;quot;orderby c.lastname&amp;quot;&lt;/span&gt; +
    &lt;span style="color:#A31515;"&gt;&amp;quot;select {lastname: c.lastname, items: o.items}&amp;quot;&lt;/span&gt;,
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Unless&lt;/b&gt; you are willing to let language specifications be language specifications and exploit a bug/feature found in pretty much all JavaScript implementations:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &amp;quot;from c &lt;span style="color:Blue;"&gt;in&lt;/span&gt; customers \
    join o &lt;span style="color:Blue;"&gt;in&lt;/span&gt; orders on c.id equals o.customerId \
    where o.items &amp;gt; 10 \
    orderby c.lastname \
    select {lastname: c.lastname, items: o.items}&amp;quot;,
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Yes, it&amp;#39;s still ugly, but less so. Note that there cannot be any whitespace after the backslash at the end of each line. If you choose to use this &amp;quot;feature&amp;quot;, make sure you thoroughly test your application in all browsers that you are targeting.&lt;br /&gt;
&lt;h3&gt;Methods&lt;/h3&gt;jsinq.Query provides the following methods:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Method &lt;/th&gt;&lt;th&gt; Static &lt;/th&gt;&lt;th&gt; Description &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; setValue &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Binds a specified value to a placeholder  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; execute &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Executes the query and returns the result  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; getQueryFunction &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the anonymous function that executes the query  &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:16:09 GMT</pubDate><guid isPermaLink="false">Updated Wiki: jsinq.Query 20100327021609P</guid></item><item><title>Updated Wiki: jsinq.Enumerable</title><link>http://jsinq.codeplex.com/wikipage?title=jsinq.Enumerable&amp;version=2</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;From LINQ to JSINQ&lt;/h2&gt;The heart of JSINQ is &lt;b&gt;jsinq.Enumerable&lt;/b&gt; which is a faithful implementation of System.Linq.Enumerable in JavaScript. It differs from its .NET counterpart in that it uses JavaScript naming conventions, lacks types and has a few subtle differences in how it handles overloads. In general though, it is API-compatible with the .NET implementation. What that means is that you can use the .NET documentation for reference: &lt;a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable_members.aspx" class="externalLink"&gt;http://msdn.microsoft.com/en-us/library/system.linq.enumerable_members.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;jsinq.Enumerable&lt;/h2&gt;jsinq.Enumerable unlike its .NET counterpart is an actual constructor that you can use to create enumerables from arrays or DOM node lists. Let&amp;#39;s look at an example:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; nodes = document.getElementsByTagName(&lt;span style="color:#A31515;"&gt;&amp;#39;*&amp;#39;&lt;/span&gt;);
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; enumerable = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Enumerable(nodes);
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;The variable &amp;quot;enumerable&amp;quot; now holds a new enumerable that can be used to enumerate over the elements of the node list. To do so, simply write:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; enumerator = enumerable.getEnumerator();
&lt;span style="color:Blue;"&gt;while&lt;/span&gt; (enumerator.moveNext()) {
    &lt;span style="color:Blue;"&gt;var&lt;/span&gt; current = enumerator.next();
    &lt;span style="color:Green;"&gt;// do something with &amp;quot;current&amp;quot; here&lt;/span&gt;
}
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You can also write your own enumerables; all you have to do is implement the method &lt;i&gt;getEnumerator&lt;/i&gt; and then return an object that supports the three methods &lt;i&gt;current&lt;/i&gt;, &lt;i&gt;moveNext&lt;/i&gt; and &lt;i&gt;reset&lt;/i&gt;. The signatures and semantics of these methods are described here: &lt;a href="http://msdn.microsoft.com/en-us/library/system.collections.ienumerator_members.aspx" class="externalLink"&gt;http://msdn.microsoft.com/en-us/library/system.collections.ienumerator_members.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. Also check out the implementation of &lt;i&gt;Enumerable.range&lt;/i&gt; in the file &amp;quot;jsinq.js&amp;quot;. If you set the prototype of your enumerable to &lt;i&gt;jsinq.Enumerable.prototype&lt;/i&gt;, you get all of its querying-goodness for free.&lt;br /&gt;
&lt;h3&gt;Methods&lt;/h3&gt;jsinq.Enumerable provides the following methods:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Method &lt;/th&gt;&lt;th&gt; Static &lt;/th&gt;&lt;th&gt; Description &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; aggregate &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Accumulates the elements of an Enumerable using an accumulator function.  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; all &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns true if all elements in the Enumerable satisfy the specified condition.  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; any &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns true if the Enumerable contains any elements or if at  least one of the elements in the Enumerable satisfy a specified condition. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; average &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the average of the elements in the Enumerable, optionally using the specified selector function. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; concat &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Creates a new Enumerable that is the result of the concatenation of two Enumerables. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; contains &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns true if the Enumerable contains the specified element. Optionally uses the specified comparer. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; count &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the number of elements in the Enumerable. If a predicate function is specified, only those elements will be counted that satisfy the given condition. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; defaultIfEmpty &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the Enumerable or a new Enumerable containing only the specified default value, should the Enumerable be empty. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; distinct &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a new Enumerable that contains only distinct elements. Optionally uses a specified comparer. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; elementAt &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the element at the specified offset or throws an exception if the index is out of bounds. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; elementAtOrDefault &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Same as elementAt, except it returns the specified defaultValue if the given index is out of bounds. This differs from the LINQ implementation in that the default value needs to be specified explicitly. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; empty &lt;/td&gt;&lt;td&gt; yes &lt;/td&gt;&lt;td&gt; Returns an empty Enumerable &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; except &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a new Enumerable containing all elements from this Enumerable except those contained in a second Enumerable (i.e. the set difference between two enumerables). Optionally uses the specified comparer. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; first &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the first element in the Enumerable or throws an exception if the Enumerable is empty. If a predicate function is specified, the method returns the first element that satisfies the given condition. If the Enumerable is empty or no element satisfies the specified condition, an exception is thrown. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; firstOrDefault &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Same as first, except it returns a specified defaultValue if the Enumerable is empty or no element satisfies the specified condition. This method is different from its LINQ counterpart in that it requires the default value to be specified explicitly. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; groupBy &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Groups the elements in the Enumerable. Note that this method resolves overloads based on function arity. Result selectors are expected to have two or more formal parameters while element- and key-selectors are expected to have just one. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; groupJoin &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Correlates the elements in two Enumerables based on their keys  and groups the results.  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; intersect &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a new Enumerable that is the result of the intersection of two Enumerables. Optionally uses the specified comparer. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; join &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Correlates the elements in two Enumerables based on their keys.  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; last &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the last element in the Enumerable or throws an exception, if the Enumerable is empty. If a predicate function is specified, the method returns the last element that satisfies the given condition. If no element satisfies the specified condition, an exception is thrown. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; lastOrDefault &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Same as last, except it returns a specified defaultValue if the Enumerable is empty or not element satisfies the specified condition. This method is different from its LINQ counterpart in that it requires the default value to be specified explicitly. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; max &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the maximum value in the Enumerable. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; min &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the minimum value in the Enumerable. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; orderBy &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Sorts the elements in the Enumerable in ascending order. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; orderByDescending &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Sorts the elements in the Enumerable in descending order. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; repeat &lt;/td&gt;&lt;td&gt; yes &lt;/td&gt;&lt;td&gt; Returns an Enumerable that contains the specified element &amp;quot;count&amp;quot; times &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; reverse &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Reverses the order of the elements in the Enumerable. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; select &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Projects each of the elements in the Enumerable into a new form. This differes from its LINQ counterpart in that the selector function always receives the index of the current element as its second parameter. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; selectMany &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Projects each of the elements in the Enumerable into a new  Enumerable and then flattens the result into a single Enumerable again. This differes from its LINQ counterpart in that the collection selector function always receives the index of the current element as its second parameter. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; sequenceEqual &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns true if the Enumerable is identical to another  Enumerable by comparing the elements using an optional  comparer. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; single &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the only element in the Enumerable or throws an exception either if the Enumerable is empty or if there is more  than one element in the Enumerable. Optionally tests the  returned element against a predicate function and throws an  exception if the element does not satisfy its condition. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; singleOrDefault &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Same as single, except that a specified default value is  returned if the Enumerable is empty, contains more than one  element or if the element does not satisfy the specified  condition. This method differs from its LINQ counterpart in  that it requires the default value to be specified explicitly. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; skip &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a new Enumerable that is the result of skipping the  first &amp;quot;count&amp;quot; elements of the Enumerable.    &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; skipWhile &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a new Enumerable that is the result of skipping all  elements from the beginning of the Enumerable that satisfy a   specified condition. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; sum &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the sum of the elements in the Enumerable, optionally  using a specified selector. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; take &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a new Enumerable that is the result of extracting the  first &amp;quot;count&amp;quot; elements from the Enumerable. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; takeWhile &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a new Enumerable that is the result of extracting all elements from the beginning of the Enumerable that satisfy the   specified condition. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toArray &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an array containg all the elements in Enumerable. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toList &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a jsinq.List containg all the elements in Enumerable. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toDictionary &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a jsinq.Dictionary containg all the elements in Enumerable. A key selector is used to determine the key for each element. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toLookup &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a jsinq.Lookup containg all the elements in Enumerable. A key selector ise used to determine the key for each element. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; union &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a new Enumerable that is the union of two Enumerables.  Optionally uses the specified comparer. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; where &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a new Enumerable that contains only the elements of the Enumerable that satisfy the specified condition. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; zip &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a new Enumerable that is the result of merging two Enumerables using a specified result selector. &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Please check out the official .NET reference for additional information on how to use these methods: &lt;a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable_members.aspx" class="externalLink"&gt;http://msdn.microsoft.com/en-us/library/system.linq.enumerable_members.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;Also look at the comments in the source code and of course the examples.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:15:57 GMT</pubDate><guid isPermaLink="false">Updated Wiki: jsinq.Enumerable 20100327021557P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://jsinq.codeplex.com/documentation?version=3</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;JSINQs architecture&lt;/h2&gt;JSINQ is split-up into two parts. &lt;b&gt;jsinq.Enumerable&lt;/b&gt; is JSINQ&amp;#39;s implementation of System.Linq.Enumerable and &lt;b&gt;jsinq.Query&lt;/b&gt; is JSINQ&amp;#39;s query-expression compiler. This separation was done quite consciously for two reasons: for one, the query-expression compiler is big and you shouldn&amp;#39;t have to carry around its weight when you&amp;#39;re not actually using it and secondly, the query-expression compiler is in a reather experimental state while the &amp;quot;Enumerable&amp;quot; implementation is actually quite solid. &lt;br /&gt;
&lt;h2&gt;Get Started&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Documentation"&gt;JSINQ in a nutshell&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;JSINQ Reference&lt;/h2&gt;
&lt;h3&gt;Types&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.Enumerable&amp;referringTitle=Documentation"&gt;jsinq.Enumerable&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.Query&amp;referringTitle=Documentation"&gt;jsinq.Query&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.List&amp;referringTitle=Documentation"&gt;jsinq.List&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.Dictionary&amp;referringTitle=Documentation"&gt;jsinq.Dictionary&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:15:44 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20100327021544P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://jsinq.codeplex.com/documentation?version=2</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;JSINQs architecture&lt;/h2&gt;JSINQ is split-up into two parts. &lt;b&gt;jsinq.Enumerable&lt;/b&gt; is JSINQ&amp;#39;s implementation of System.Linq.Enumerable and &lt;b&gt;jsinq.Query&lt;/b&gt; is JSINQ&amp;#39;s query-expression compiler. This separation was done quite consciously for two reasons: for one, the query-expression compiler is big and you shouldn&amp;#39;t have to carry around its weight when you&amp;#39;re not actually using it and secondly, the query-expression compiler is in a reather experimental state while the &amp;quot;Enumerable&amp;quot; implementation is actually quite solid. &lt;br /&gt;
&lt;h1&gt;Get Started&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Documentation"&gt;JSINQ in a nutshell&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;JSINQ Reference&lt;/h2&gt;
&lt;h3&gt;Types&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.Enumerable&amp;referringTitle=Documentation"&gt;jsinq.Enumerable&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.Query&amp;referringTitle=Documentation"&gt;jsinq.Query&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.List&amp;referringTitle=Documentation"&gt;jsinq.List&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.Dictionary&amp;referringTitle=Documentation"&gt;jsinq.Dictionary&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:15:31 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20100327021531P</guid></item><item><title>Updated Wiki: JSINQ in a nutshell</title><link>http://jsinq.codeplex.com/wikipage?title=JSINQ in a nutshell&amp;version=6</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;Including the JSINQ files&lt;/h2&gt;JSINQ consists of two components, jsinq.Enumerable and jsinq.Query. The &amp;quot;Enumerable&amp;quot; component is a complete, API-compatible implementation of the .NET class &lt;a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable_members.aspx" class="externalLink"&gt;System.Linq.Enumerable&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. To use jsinq.Enumerable, you need to include the &amp;quot;jsinq.js&amp;quot; file in your HTML page like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&amp;lt;script type=&lt;span style="color:#A31515;"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; src=&lt;span style="color:#A31515;"&gt;&amp;quot;jsinq.js&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;It is recommended that you use the file found in the &amp;quot;build&amp;quot; folder as it is substantially smaller than the un-minified file found in the &amp;quot;source&amp;quot; folder.&lt;br /&gt;&lt;br /&gt;If you also want to use jsinq.Query (see below), you&amp;#39;ll also have to include the file &amp;quot;jsinq-query.js&amp;quot;.&lt;br /&gt;
&lt;h2&gt;Writing queries using query-methods&lt;/h2&gt;Once you have included the file(s), you can start to write queries against arrays, DOM node lists or your own enumerable objects. An example:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; names = [&lt;span style="color:#A31515;"&gt;&amp;#39;Bob&amp;#39;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;#39;Alice&amp;#39;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;#39;Joe&amp;#39;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;#39;Frank&amp;#39;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;#39;Arthur&amp;#39;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;#39;Marcy&amp;#39;&lt;/span&gt;];
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; enumerable = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Enumerable(names);

&lt;span style="color:Blue;"&gt;var&lt;/span&gt; namesThatStartWithAnA = enumerable.where(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(name) { 
	&lt;span style="color:Blue;"&gt;return&lt;/span&gt; name.charAt(0) == &lt;span style="color:#A31515;"&gt;&amp;#39;A&amp;#39;&lt;/span&gt;; 
});
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;The variable &amp;quot;namesThatStartWithAnA&amp;quot; now refers to an enumerable that will return all the names in the &amp;quot;names&amp;quot; array that start with a capital &amp;quot;A&amp;quot; when enumerated. To enumerate an enumerable, do the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; enumerator = namesThatStartWithAnA.getEnumerator();
&lt;span style="color:Blue;"&gt;while&lt;/span&gt; (enumerator.moveNext()) {
	&lt;span style="color:Blue;"&gt;var&lt;/span&gt; name = enumerator.current();
	document.write(name + &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;lt;br /&amp;gt;&amp;#39;&lt;/span&gt;);
}
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;There is also a convenient helper-method that makes enumerating over the elements in an enumerable much easier:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
namesThatStartWithAnA.each(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(name) {
	document.write(name + &lt;span style="color:#A31515;"&gt;&amp;#39;&amp;lt;br /&amp;gt;&amp;#39;&lt;/span&gt;);
});
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You can create more complex queries by chaining together multiple query-methods like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; result = enumerable.where(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(name) { 
	&lt;span style="color:Blue;"&gt;return&lt;/span&gt; name.toLowerCase().indexOf(&lt;span style="color:#A31515;"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;) &amp;gt; -1; 
}).orderByDescending(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(name) { 
	&lt;span style="color:Blue;"&gt;return&lt;/span&gt; name; 
});
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;When enumerating the enumerator referred to by the variable &amp;quot;result&amp;quot;, you will receive a list of all names that contain an &amp;quot;a&amp;quot; in a reverse alphabetical order.&lt;br /&gt;&lt;br /&gt;Using this &amp;quot;pattern&amp;quot;, you can create arbitrarily complex queries. Unfortunately, the simple query above already looks quite complex and as you keep adding clauses to your query, it will become increasingly difficult to see what the result of a query is going to be. &lt;br /&gt;
&lt;h2&gt;Writing queries using query expressions&lt;/h2&gt;Fortunately, chaining together query-methods is not the only way of defining a query in JSINQ. Instead, you can write your queries in a more natural, SQL-like fashion:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&amp;#39; \
	from name &lt;span style="color:Blue;"&gt;in&lt;/span&gt; $0 \
	where name.toLowerCase().indexOf(&lt;span style="color:#A31515;"&gt;&amp;quot;a&amp;quot;&lt;/span&gt;) &amp;gt; -1 \
	orderby name descending \
	select name \
&amp;#39;);
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;So what is going on here? The Query constructor provided by JSINQ receives a string containing a LINQ expression and essentially compiles it into JavaScript code. Unsurprisingly, the JavaScript code produced by the query compiler looks exactly like the code in the previous examples. Looking at the code above however, you might notice two things that are weird. For one, what is up with all the backslashes? JavaScript does not officially support multi-line strings which is a bummer, because queries look so much nicer when you put each clause on a separate line. Multi-line strings can however be simulated by placing a backslash at the end of each line. This is slightly evil because it is not in any way mentioned in the JavaScript language specification, but it appears to work in most browsers (read: use with caution and at your own risk). Secondly, what is &amp;quot;$0&amp;quot;? The JSINQ Query object essentially acts like a prepared statement. When you create a new Query object, you invoke the query compiler but the query is not actually executed. That way, you can use the same query many times without having to re-compile it over and over again. What&amp;#39;s even better is, that you can apply the same query to different datasets without having to re-compile it. This is where placeholders come into play. You can use placeholders in your query, where you would otherwise use an identifier or an expression. Using the &amp;quot;setValue&amp;quot; method of the Query object, you can then assign a concrete value to each placeholder like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
query.setValue(0, enumerable);
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;This assigns our enumerable (the one with the names in it) to placeholder &amp;quot;$0&amp;quot;. Once you have assigned a value to each placeholder, you can execute a query by invoking its &amp;quot;execute&amp;quot; method. Our example in its entirety now looks like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&amp;#39; \
	from name &lt;span style="color:Blue;"&gt;in&lt;/span&gt; $0 \
	where name.toLowerCase().indexOf(&lt;span style="color:#A31515;"&gt;&amp;quot;a&amp;quot;&lt;/span&gt;) &amp;gt; -1 \
	orderby name descending \
	select name \
&amp;#39;);

query.setValue(0, enumerable);
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; result = query.execute();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;The variable &amp;quot;result&amp;quot; now contains the enumerable that is the result of applying our query to the enumerable that we have specified using the &amp;quot;setValue&amp;quot; method.&lt;br /&gt;
&lt;h2&gt;What&amp;#39;s next?&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Download JSINQ!&lt;/li&gt;
&lt;li&gt;Read the &lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20reference&amp;referringTitle=JSINQ%20in%20a%20nutshell"&gt;JSINQ reference&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:14:57 GMT</pubDate><guid isPermaLink="false">Updated Wiki: JSINQ in a nutshell 20100327021457P</guid></item><item><title>Updated Wiki: Home</title><link>http://jsinq.codeplex.com/wikipage?version=17</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;JSINQ 1.0 out now!&lt;/h2&gt;JSINQ 1.0, the first &lt;b&gt;stable release&lt;/b&gt; of JSINQ is available for download right now! It is packed with new features such as
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Support for all .NET 3.5 query operators&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Experimental support for the &lt;b&gt;.NET 4.0 query operator &amp;quot;zip&amp;quot;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Complete, fully tested &lt;b&gt;implementations of System.Collections.Generic.List&lt;/b&gt; and &lt;b&gt;System.Collections.Generic.Dictionary&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;toList, toDictionary and toLookup&lt;/b&gt; now available for jsinq.Enumerable&lt;/li&gt;
&lt;li&gt;Still &lt;b&gt;only 23 KB when minified&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://kaijaeger.com/downloads/jsinq/playground/" class="externalLink"&gt;Try it yourself online!&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;Get started with JSINQ&amp;#33;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/documentation?referringTitle=Home"&gt;Read the documentation&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;What is JSINQ?&lt;/h2&gt;&lt;b&gt;JSINQ is the JavaScript library that allows you to write SQL-like queries against arrays and DOM node lists.&lt;/b&gt;&lt;br /&gt;JSINQ is a complete implementation of LINQ to Objects (the .NET 4.0 version) in JavaScript. What that means is that if you know LINQ and you know JavaScript, you know JSINQ. JSINQ is both an API-compatible implementation of System.Linq.Enumerable and a complete query-expression compiler. That&amp;#39;s right: &lt;i&gt;you can write LINQ-style queries in JavaScript&lt;/i&gt;. And if that isn&amp;#39;t enough: JSINQ is also very liberally licensed, well-document, well-tested (the Enumerable-part) and &lt;b&gt;a stable version has just been released&lt;/b&gt;. So give it a go!&lt;br /&gt;
&lt;h2&gt;What does it look like?&lt;/h2&gt;Let&amp;#39;s say you have an array of &lt;i&gt;customers&lt;/i&gt; and an array of &lt;i&gt;orders&lt;/i&gt; and you want to assemble a list of top customers, that is a list of customers who have in total ordered more than ten items. With JSINQ, you might write something like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&amp;#39;\
    from order &lt;span style="color:Blue;"&gt;in&lt;/span&gt; $1 \
    group order by order.customerId into g \
    select {customerId: g.getKey(), items: g.sum(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(g) { &lt;span style="color:Blue;"&gt;return&lt;/span&gt; g.items; })} \
    into h \
    join customer &lt;span style="color:Blue;"&gt;in&lt;/span&gt; $0 on h.customerId equals customer.id \
    where h.items &amp;gt; 10 \
    orderby h.items descending \
    select {lastname: customer.lastname, items: h.items} \
&amp;#39;);

query.setValue(0, customers);
query.setValue(1, orders);
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; result = query.execute();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Confused? What&amp;#39;s with all the backslashes?&lt;/b&gt; Please read: &lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;JSINQ in a nutshell&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;What can I do with JSINQ?&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Write arbitrarily complex queries against JavaScript arrays, DOM node lists or your own enumerable types&lt;/li&gt;
&lt;li&gt;Find elements in the HTML DOM tree using SQL-like queries&lt;/li&gt;
&lt;li&gt;Dynamically create HTML elements from JSON you have received via XMLHttpRequest in a declarative manner&lt;/li&gt;
&lt;li&gt;Tinker with XML and turn it into something else&lt;/li&gt;
&lt;li&gt;Combine it in interesting ways with the JavaScript-/Ajax-frameworks you are already using&lt;/li&gt;
&lt;li&gt;Write less code by exploiting the power of declarative programming&lt;/li&gt;
&lt;li&gt;And for the ambitious: write &lt;a href="http://blogs.msdn.com/lukeh/archive/2007/10/01/taking-linq-to-objects-to-extremes-a-fully-linqified-raytracer.aspx" class="externalLink"&gt;raytracers&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/lukeh/archive/2007/08/19/monadic-parser-combinators-using-c-3-0.aspx" class="externalLink"&gt;monadic parser combinators&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, etc.&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Using JSINQ&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;JSINQ in a nutshell&lt;/a&gt;&lt;/b&gt; (new to JSINQ?, read this!)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/documentation?referringTitle=Home"&gt;JSING Documentation&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=Frequently%20asked%20questions&amp;referringTitle=Home"&gt;Frequently asked questions&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Previous work&lt;/h2&gt;JSINQ isn&amp;#39;t the first attempt at implementing LINQ in JavaScript. There is also Chris Pietschmann&amp;#39;s &lt;a href="http://www.codeplex.com/JSLINQ" class="externalLink"&gt;LINQ to JavaScript&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; (right here on CodePlex), there is &lt;a href="http://plugins.jquery.com/project/jLINQ" class="externalLink"&gt;jLINQ&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and then there is &lt;a href="http://netindonesia.net/blogs/jimmy/archive/2007/07/16/Javascript-LINQ_3F003F003F00_.aspx" class="externalLink"&gt;this&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:14:31 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20100327021431P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://jsinq.codeplex.com/documentation?version=1</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;JSINQs architecture&lt;/h2&gt;JSINQ is split-up into two parts. &lt;b&gt;jsinq.Enumerable&lt;/b&gt; is JSINQ&amp;#39;s implementation of System.Linq.Enumerable and &lt;b&gt;jsinq.Query&lt;/b&gt; is JSINQ&amp;#39;s query-expression compiler. This separation was done quite consciously for two reasons: for one, the query-expression compiler is big and you shouldn&amp;#39;t have to carry around its weight when you&amp;#39;re not actually using it and secondly, the query-expression compiler is in a reather experimental state while the &amp;quot;Enumerable&amp;quot; implementation is actually quite solid. &lt;br /&gt;
&lt;h2&gt;JSINQ Reference&lt;/h2&gt;
&lt;h3&gt;Types&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.Enumerable&amp;referringTitle=Documentation"&gt;jsinq.Enumerable&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.Query&amp;referringTitle=Documentation"&gt;jsinq.Query&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.List&amp;referringTitle=Documentation"&gt;jsinq.List&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.Dictionary&amp;referringTitle=Documentation"&gt;jsinq.Dictionary&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:13:41 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20100327021341P</guid></item><item><title>Updated Wiki: Home</title><link>http://jsinq.codeplex.com/wikipage?version=16</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;JSINQ 1.0 out now!&lt;/h2&gt;JSINQ 1.0, the first &lt;b&gt;stable release&lt;/b&gt; of JSINQ is available for download right now! It is packed with new features such as
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Support for all .NET 3.5 query operators&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Experimental support for the &lt;b&gt;.NET 4.0 query operator &amp;quot;zip&amp;quot;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Complete, fully tested &lt;b&gt;implementations of System.Collections.Generic.List&lt;/b&gt; and &lt;b&gt;System.Collections.Generic.Dictionary&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;toList, toDictionary and toLookup&lt;/b&gt; now available for jsinq.Enumerable&lt;/li&gt;
&lt;li&gt;Still &lt;b&gt;only 23 KB when minified&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://kaijaeger.com/downloads/jsinq/playground/" class="externalLink"&gt;Try it yourself online!&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;Get started with JSINQ&amp;#33;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20reference&amp;referringTitle=Home"&gt;Read the reference&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;What is JSINQ?&lt;/h2&gt;&lt;b&gt;JSINQ is the JavaScript library that allows you to write SQL-like queries against arrays and DOM node lists.&lt;/b&gt;&lt;br /&gt;JSINQ is a complete implementation of LINQ to Objects (the .NET 4.0 version) in JavaScript. What that means is that if you know LINQ and you know JavaScript, you know JSINQ. JSINQ is both an API-compatible implementation of System.Linq.Enumerable and a complete query-expression compiler. That&amp;#39;s right: &lt;i&gt;you can write LINQ-style queries in JavaScript&lt;/i&gt;. And if that isn&amp;#39;t enough: JSINQ is also very liberally licensed, well-document, well-tested (the Enumerable-part) and &lt;b&gt;a stable version has just been released&lt;/b&gt;. So give it a go!&lt;br /&gt;
&lt;h2&gt;What does it look like?&lt;/h2&gt;Let&amp;#39;s say you have an array of &lt;i&gt;customers&lt;/i&gt; and an array of &lt;i&gt;orders&lt;/i&gt; and you want to assemble a list of top customers, that is a list of customers who have in total ordered more than ten items. With JSINQ, you might write something like this:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&amp;#39;\
    from order &lt;span style="color:Blue;"&gt;in&lt;/span&gt; $1 \
    group order by order.customerId into g \
    select {customerId: g.getKey(), items: g.sum(&lt;span style="color:Blue;"&gt;function&lt;/span&gt;(g) { &lt;span style="color:Blue;"&gt;return&lt;/span&gt; g.items; })} \
    into h \
    join customer &lt;span style="color:Blue;"&gt;in&lt;/span&gt; $0 on h.customerId equals customer.id \
    where h.items &amp;gt; 10 \
    orderby h.items descending \
    select {lastname: customer.lastname, items: h.items} \
&amp;#39;);

query.setValue(0, customers);
query.setValue(1, orders);
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; result = query.execute();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Confused? What&amp;#39;s with all the backslashes?&lt;/b&gt; Please read: &lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;JSINQ in a nutshell&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;What can I do with JSINQ?&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Write arbitrarily complex queries against JavaScript arrays, DOM node lists or your own enumerable types&lt;/li&gt;
&lt;li&gt;Find elements in the HTML DOM tree using SQL-like queries&lt;/li&gt;
&lt;li&gt;Dynamically create HTML elements from JSON you have received via XMLHttpRequest in a declarative manner&lt;/li&gt;
&lt;li&gt;Tinker with XML and turn it into something else&lt;/li&gt;
&lt;li&gt;Combine it in interesting ways with the JavaScript-/Ajax-frameworks you are already using&lt;/li&gt;
&lt;li&gt;Write less code by exploiting the power of declarative programming&lt;/li&gt;
&lt;li&gt;And for the ambitious: write &lt;a href="http://blogs.msdn.com/lukeh/archive/2007/10/01/taking-linq-to-objects-to-extremes-a-fully-linqified-raytracer.aspx" class="externalLink"&gt;raytracers&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/lukeh/archive/2007/08/19/monadic-parser-combinators-using-c-3-0.aspx" class="externalLink"&gt;monadic parser combinators&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, etc.&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Using JSINQ&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20in%20a%20nutshell&amp;referringTitle=Home"&gt;JSINQ in a nutshell&lt;/a&gt;&lt;/b&gt; (new to JSINQ?, read this!)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=JSINQ%20reference&amp;referringTitle=Home"&gt;JSINQ reference&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=Frequently%20asked%20questions&amp;referringTitle=Home"&gt;Frequently asked questions&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Previous work&lt;/h2&gt;JSINQ isn&amp;#39;t the first attempt at implementing LINQ in JavaScript. There is also Chris Pietschmann&amp;#39;s &lt;a href="http://www.codeplex.com/JSLINQ" class="externalLink"&gt;LINQ to JavaScript&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; (right here on CodePlex), there is &lt;a href="http://plugins.jquery.com/project/jLINQ" class="externalLink"&gt;jLINQ&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and then there is &lt;a href="http://netindonesia.net/blogs/jimmy/archive/2007/07/16/Javascript-LINQ_3F003F003F00_.aspx" class="externalLink"&gt;this&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:11:31 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20100327021131P</guid></item><item><title>Updated Wiki: jsinq.List</title><link>http://jsinq.codeplex.com/wikipage?title=jsinq.List&amp;version=2</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;jsinq.List&lt;/h2&gt;
As of version 1.0, JSINQ contains a complete implementation of System.Collections.Generic.List that you can use independently of the querying functionality. To use JSINQ&amp;#39;s list implementation, all you have to do is include the file &amp;quot;jsinq.js&amp;quot;. You can then use jsinq.List like you would System.Collections.Generic.List:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; list = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.List();
list.add(&lt;span style="color:#A31515;"&gt;&amp;quot;JSINQ&amp;quot;&lt;/span&gt;);
list.insert(0, &lt;span style="color:#A31515;"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;);
list.removeAt(1);
alert(list.item(0);
list.set(0, &lt;span style="color:#A31515;"&gt;&amp;quot;Test&amp;quot;&lt;/span&gt;);
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You can also turn any jsinq.Enumerable into a list by invoking its &amp;quot;toList&amp;quot; method.&lt;br /&gt;
&lt;h3&gt;Methods&lt;/h3&gt;jsinq.List provides the following methods:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Method &lt;/th&gt;&lt;th&gt; Static &lt;/th&gt;&lt;th&gt; Description &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; add &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Adds the specified item to the end of the list  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; item &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Retrieves the element at the specified index  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; set &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Sets the element at the specified index  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; addRange &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Adds the elements of the specified collection to the end of the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; asReadOnly &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Return a read-only list wrapper for the current collection &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; binarySearch &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Searches a sorted list for the given element &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; clear &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Empties the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; copyTo &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Copies a range of elements from the list to the specified array &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; exists &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a boolean value indicating whether the list contains any elements satisfying the condition defined by the given predicate function &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; find &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the first occurrence of an element that satisfies the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; findAll &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Retrieves all the elements from the list that satisfy the condtion defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; findIndex &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the index of the first element in the list that satisfies the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; findLast &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the last occurrence of an element that satisfies the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; findLastIndex &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the index of the last element in the list that satisfies the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; forEach &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Performs the specified action for each element in the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; getEnumerator &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an enumerator that iterates through the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; getRange &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Extracts a range of elements from the list. The operation performs a shallow copy of the extracted elements, i.e. reference types are not cloned. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; indexOf &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the index of the first occurrence of the specified item in the list or a part thereof &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; insert &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Inserts the specified element into the list at the specified position &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; insertRange &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Inserts the elements in the specified collection into the list at the specified position &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; lastIndexOf &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the index of the last occurrence of the specified item in the list or a part thereof &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; remove &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Removes the specified item from the list. Returns a boolean value indicating whether the operation was successful &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; removeAll &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Removes all the elements from the list that satisfy the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; removeAt &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Removes the element at the given index from the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; removeRange &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Removes a range of elements from the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; reverse &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Reverses the order of the elements in the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; sort &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Sorts the elements in the list or a portion thereof &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toArray &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an array containing the elements in the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toString &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a string representing the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; isReadOnly &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Indicates whether this list is read-only &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; trueForAll &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns true if all elements in the list satisfy the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Please check out the official .NET reference for additional information on how to use these methods: &lt;a href="http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx" class="externalLink"&gt;http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;Also look at the comments in the source code and of course the examples.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:10:42 GMT</pubDate><guid isPermaLink="false">Updated Wiki: jsinq.List 20100327021042P</guid></item><item><title>Updated Wiki: jsinq.Dictionary</title><link>http://jsinq.codeplex.com/wikipage?title=jsinq.Dictionary&amp;version=1</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;jsinq.Dictionary&lt;/h2&gt;
Since its initial release, JSINQ has been expanded to also contain the two collection classes jsinq.List and jsinq.Dictionary. jsinq.Dictionary is a complete implementation of System.Collections.Generic.Dictionary. Unlike JavaScript&amp;#39;s object type, jsinq.Dictionary supports arbitrary values as keys. &lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; dictionary = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Dictionary();
dictionary.set(&lt;span style="color:#A31515;"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;quot;World&amp;quot;&lt;/span&gt;);
alert(dictionary.item(&lt;span style="color:#A31515;"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;)); &lt;span style="color:Green;"&gt;// alerts &amp;quot;World&amp;quot;&lt;/span&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; myKey = { foo: 123 };
dictionary.set(myKey, &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Date());
alert(dictionary.containsKey(myKey)); &lt;span style="color:Green;"&gt;// alerts &amp;quot;true&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You can also turn any jsinq.Enumerable into a dictionary by invoking its &amp;quot;toDictionary&amp;quot; method.&lt;br /&gt;
&lt;h3&gt;Methods&lt;/h3&gt;jsinq.Dictionary provides the following methods:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Method &lt;/th&gt;&lt;th&gt; Static &lt;/th&gt;&lt;th&gt; Description &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; item &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Retrieves the value associated with the specified key  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; set &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Sets the value associated with the specified key. An existing value associated with the key will be replaced. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; count &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the number of key-value pairs in this dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; getComparer &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Retrieves the comparer associated with this dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; add &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Adds the specified key and value to the dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; tryAdd &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Attempts to add the specified key and value to the dictionary. Returns a boolean value indicating whether the operation was successful. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; keys &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an array containing the keys in this dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; values &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an array containing the values in this dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; clear &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Empties the dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; containsKey &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a boolean value indicating whether the specified key is contained within the dictionary. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; containsValue &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a boolean value indicating whether the specified value is contained within the dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; getEnumerator &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an enumerator that iterates over this dictionary &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toArray &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an array containing the keys and values in this dictionary dictionary. Returns a boolean value indicating whether the operation was successful. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; isReadOnly &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Indicates whether this dictionary is read-only &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toString &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a string representing the dictionary &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Please check out the official .NET reference for additional information on how to use these methods: &lt;a href="http://msdn.microsoft.com/en-us/library/xfhwa508.aspx" class="externalLink"&gt;http://msdn.microsoft.com/en-us/library/xfhwa508.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;Also look at the comments in the source code and of course the examples.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 14:09:52 GMT</pubDate><guid isPermaLink="false">Updated Wiki: jsinq.Dictionary 20100327020952P</guid></item><item><title>Updated Wiki: JSINQ reference</title><link>http://jsinq.codeplex.com/wikipage?title=JSINQ reference&amp;version=6</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;JSINQs architecture&lt;/h2&gt;JSINQ is split-up into two parts. &lt;b&gt;jsinq.Enumerable&lt;/b&gt; is JSINQ&amp;#39;s implementation of System.Linq.Enumerable and &lt;b&gt;jsinq.Query&lt;/b&gt; is JSINQ&amp;#39;s query-expression compiler. This separation was done quite consciously for two reasons: for one, the query-expression compiler is big and you shouldn&amp;#39;t have to carry around its weight when you&amp;#39;re not actually using it and secondly, the query-expression compiler is in a reather experimental state while the &amp;quot;Enumerable&amp;quot; implementation is actually quite solid. &lt;br /&gt;
&lt;h2&gt;JSINQ Reference&lt;/h2&gt;
&lt;h3&gt;Types&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.Enumerable&amp;referringTitle=JSINQ%20reference"&gt;jsinq.Enumerable&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.Query&amp;referringTitle=JSINQ%20reference"&gt;jsinq.Query&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.List&amp;referringTitle=JSINQ%20reference"&gt;jsinq.List&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jsinq.codeplex.com/wikipage?title=jsinq.Dictionary&amp;referringTitle=JSINQ%20reference"&gt;jsinq.Dictionary&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 13:57:59 GMT</pubDate><guid isPermaLink="false">Updated Wiki: JSINQ reference 20100327015759P</guid></item><item><title>Updated Wiki: jsinq.List</title><link>http://jsinq.codeplex.com/wikipage?title=jsinq.List&amp;version=1</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;jsinq.List&lt;/h2&gt;
As of version 1.0, JSINQ contains a complete implementation of System.Collections.Generic.List that you can use independently of the querying functionality. To use JSINQ&amp;#39;s list implementation, all you have to do is include the file &amp;quot;jsinq.js&amp;quot;. You can then use jsinq.List like you would System.Collections.Generic.List:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; list = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.List();
list.add(&lt;span style="color:#A31515;"&gt;&amp;quot;JSINQ&amp;quot;&lt;/span&gt;);
list.insert(0, &lt;span style="color:#A31515;"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;);
list.removeAt(1);
alert(list.item(0);
list.set(0, &lt;span style="color:#A31515;"&gt;&amp;quot;Test&amp;quot;&lt;/span&gt;);
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You can also turn any jsinq.Enumerable into a list by invoking its &amp;quot;toList&amp;quot; method.&lt;br /&gt;
&lt;h3&gt;Methods&lt;/h3&gt;jsinq.List provides the following methods:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Method &lt;/th&gt;&lt;th&gt; Static &lt;/th&gt;&lt;th&gt; Description &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; add &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Adds the specified item to the end of the list  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; item &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Retrieves the element at the specified index  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; set &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Sets the element at the specified index  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; addRange &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Adds the elements of the specified collection to the end of the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; asReadOnly &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Return a read-only list wrapper for the current collection &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; binarySearch &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Searches a sorted list for the given element &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; clear &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Empties the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; copyTo &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Copies a range of elements from the list to the specified array &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; exists &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; eturns a boolean value indicating whether the list contains any elements satisfying the condition defined by the given predicate function &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; find &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the first occurrence of an element that satisfies the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; findAll &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; etrieves all the elements from the list that satisfy the condtion defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; findIndex &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the index of the first element in the list that satisfies the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; findLast &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the last occurrence of an element that satisfies the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; findLastIndex &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the index of the last element in the list that satisfies the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; forEach &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Performs the specified action for each element in the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; getEnumerator &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an enumerator that iterates through the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; getRange &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Extracts a range of elements from the list. The operation performs a shallow copy of the extracted elements, i.e. reference types are not cloned. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; indexOf &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the index of the first occurrence of the specified item in the list or a part thereof &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; insert &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Inserts the specified element into the list at the specified position &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; insertRange &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Inserts the elements in the specified collection into the list at the specified position &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; lastIndexOf &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the index of the last occurrence of the specified item in the list or a part thereof &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; remove &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Removes the specified item from the list. Returns a boolean value indicating whether the operation was successful &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; removeAll &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Removes all the elements from the list that satisfy the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; removeAt &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Removes the element at the given index from the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; removeRange &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Removes a range of elements from the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; reverse &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Reverses the order of the elements in the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; sort &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Sorts the elements in the list or a portion thereof &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toArray &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns an array containing the elements in the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; toString &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns a string representing the list &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; isReadOnly &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Indicates whether this list is read-only &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; trueForAll &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns true if all elements in the list satisfy the condition defined by the given predicate &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Please check out the official .NET reference for additional information on how to use these methods: &lt;a href="http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx" class="externalLink"&gt;http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;Also look at the comments in the source code and of course the examples.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 13:57:56 GMT</pubDate><guid isPermaLink="false">Updated Wiki: jsinq.List 20100327015756P</guid></item><item><title>Updated Wiki: jsinq.Query</title><link>http://jsinq.codeplex.com/wikipage?title=jsinq.Query&amp;version=1</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;jsinq.Query&lt;/h2&gt;jsinq.Query is where the magic happens, that is where LINQ-style queries are turned into JavaScript code. jsinq.Query depends on jsinq.Enumerable, so make sure you include both files when using the query-expression capabilities of JSINQ. &lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&lt;span style="color:#A31515;"&gt;&amp;quot;from customer in $0 where customer.lastname.charAt(&amp;#39;0&amp;#39;) == &amp;#39;S&amp;#39; select customer.lastname&amp;quot;&lt;/span&gt;);
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;This is how you create a new Query. The Query constructor receives the string that contains the query, leaving you with a Query object that is (almost) ready to use. If there is a syntactical error in your query, the query compiler will catch it and throw a &lt;b&gt;QueryTranslationException&lt;/b&gt;. Inspect the exception object to see the error message, line number and character offset at which the error occurred. Note that (for now), the error messages produced by the query compiler are pretty bad and the line number given in the exception object is often nowhere near where the actual error occurred. Also note that the query compiler will catch errors in expressions that may be part of the query, so make sure you check those as well.&lt;br /&gt;&lt;br /&gt;A query object essentially is a prepared statement, similar to those you might know from writing database applications. That means that a query object is a query waiting to be executed. Before you can do that however, you have to assign values to all placeholders that may exist in your query. Since queries are specified as strings, they are slightly detached from their surroundings and they cannot access variables from &amp;quot;the outside world&amp;quot;. This may seem like a problem, but it really isn&amp;#39;t. Where you would normally use variables, you can instead use placeholders. These are composed of a dollar sign and a number (like this: &lt;b&gt;$0&lt;/b&gt;) which makes them easy to distinguish from &amp;quot;real&amp;quot; variables. To assign a value to a placeholder, you use the &lt;i&gt;setValue&lt;/i&gt; method like so:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&lt;span style="color:#A31515;"&gt;&amp;quot;from customer in $0 where customer.lastname.charAt(&amp;#39;0&amp;#39;) == &amp;#39;S&amp;#39; select customer.lastname&amp;quot;&lt;/span&gt;);
query.setValue(0, myCustomers);
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;The nice thing about placeholders is that you can keep assigning different values to them as often as you like. So you can use the same query over and over again but have it work on different datasets, with different constraints and so forth.&lt;br /&gt;&lt;br /&gt;After you have assigned values to all placeholders, you call the &lt;i&gt;execute&lt;/i&gt; method. The execute method executes the query and returns its result (which generally is an Enumerable):&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; jsinq.Query(&lt;span style="color:#A31515;"&gt;&amp;#39;from customer in $0 where customer.lastname.charAt(&amp;#39;&lt;/span&gt;0&lt;span style="color:#A31515;"&gt;&amp;#39;) == &amp;#39;&lt;/span&gt;S&lt;span style="color:#A31515;"&gt;&amp;#39; select customer.lastname&amp;#39;&lt;/span&gt;);
query.setValue(0, myCustomers);
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; filterCustomers = query.execute();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;And that is all there is to writing queries! If you are new to LINQ and are not familiar with the query expression syntax, check out these examples: &lt;a href="http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx" class="externalLink"&gt;http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; (note that some of these are a little outdated and the syntax has since changed a little).&lt;br /&gt;
&lt;h3&gt;Spanning queries across multiple lines&lt;/h3&gt;The most common way of formatting a LINQ query is to put each clause on its own line like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
from c in customers
join o in orders on c.id equals o.customerId
where o.items &amp;gt; 10
orderby c.lastname
select {lastname: c.lastname, items: o.items} &lt;/pre&gt;&lt;br /&gt;Unfortunately, JavaScript does not natively support multi-line strings. So you&amp;#39;re stuck with writing something like this: &lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &lt;span style="color:#A31515;"&gt;&amp;quot;from c in customers&amp;quot;&lt;/span&gt; +
    &lt;span style="color:#A31515;"&gt;&amp;quot;join o in orders on c.id equals o.customerId&amp;quot;&lt;/span&gt; +
    &lt;span style="color:#A31515;"&gt;&amp;quot;where o.items &amp;gt; 10&amp;quot;&lt;/span&gt; +
    &lt;span style="color:#A31515;"&gt;&amp;quot;orderby c.lastname&amp;quot;&lt;/span&gt; +
    &lt;span style="color:#A31515;"&gt;&amp;quot;select {lastname: c.lastname, items: o.items}&amp;quot;&lt;/span&gt;,
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Unless&lt;/b&gt; you are willing to let language specifications be language specifications and exploit a bug/feature found in pretty much all JavaScript implementations:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; query = &amp;quot;from c &lt;span style="color:Blue;"&gt;in&lt;/span&gt; customers \
    join o &lt;span style="color:Blue;"&gt;in&lt;/span&gt; orders on c.id equals o.customerId \
    where o.items &amp;gt; 10 \
    orderby c.lastname \
    select {lastname: c.lastname, items: o.items}&amp;quot;,
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Yes, it&amp;#39;s still ugly, but less so. Note that there cannot be any whitespace after the backslash at the end of each line. If you choose to use this &amp;quot;feature&amp;quot;, make sure you thoroughly test your application in all browsers that you are targeting.&lt;br /&gt;
&lt;h3&gt;Methods&lt;/h3&gt;jsinq.Query provides the following methods:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Method &lt;/th&gt;&lt;th&gt; Static &lt;/th&gt;&lt;th&gt; Description &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; setValue &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Binds a specified value to a placeholder  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; execute &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Executes the query and returns the result  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; getQueryFunction &lt;/td&gt;&lt;td&gt; no &lt;/td&gt;&lt;td&gt; Returns the anonymous function that executes the query  &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>kaijaeger</author><pubDate>Sat, 27 Mar 2010 13:57:36 GMT</pubDate><guid isPermaLink="false">Updated Wiki: jsinq.Query 20100327015736P</guid></item></channel></rss>