What is the leading LINQ for JavaScript library?
I'm looking for a JavaScript library that will allow me to query complex JSON objects using a LINQ-like syntax. A quick search found a couple of promising options that look they might offer what I need:
LINQ to JavaScript and jLinq
EDIT:
Just saw this today: jslinq.
I think it will be the first one to get a thorough try-out.
Have you seen Rx for Javascript, yet? That's what you want.
You might want to check out linq.js . It follows the .NET lambda syntax and looks to be well integrated in a Microsoft environment.
LINQ for JavaScript - http://linqjs.codeplex.com/
Pros
Cons
The most basic and frequently used Linq operators are very commonly defined in widely used JS libraries. They just have different names (in fact, they have more traditional names than in Linq). Select
becomes map
, Where
becomes filter
, First
and FirstOrDefault
become [0]
.
Almost no library I know of (including I think the ones you linked to) bother to make the implementation lazy as in .NET Linq, they just evaluate immediately using arrays.
For a very nice, complete set of functional list operations, try: http://osteele.com/sources/javascript/functional/
链接地址: http://www.djcxy.com/p/51336.html上一篇: 学习LINQ和实体框架查询的资源?