LINQ for Javascript (JSON, arrays, DOM)?

I am looking for some input for using linq with javascript, there are many implementations for javascript.

Does anyone use any and which one is most compatible?

I was looking for the opportunity to use linq for JSON and DOM

Thank you in advance

+5
source share
2 answers

LINQ-like JSLINQ JavaScript library . It seems to be fully implemented.

Example from the site:

var myList = [
        {FirstName:"Chris",LastName:"Pearson"},
        {FirstName:"Kate",LastName:"Johnson"},
        {FirstName:"Josh",LastName:"Sutherland"},
        {FirstName:"John",LastName:"Ronald"},
        {FirstName:"Steve",LastName:"Pinkerton"}
        ];

var exampleArray = JSLINQ(myList)
                   .Where(function(item){ return item.FirstName == "Chris"; })
                   .OrderBy(function(item) { return item.FirstName; })
                   .Select(function(item){ return item.FirstName; });

This should be good for JSON - since JSON is basically just objects. The DOM, while functional, can be a little more awkward; you are probably best off using something else.

+4
source

JavaScript, jQuery, , , .., LINQ. , jQuery.grep() , LINQ Where(), () jQuery.map() , LINQ Select().

+1

All Articles