npm install linq
import Enumerable from "linq"
var myList = [
{ Name: "Jim", Age: 20 },
{ Name: "Kate", Age: 21 },
{ Name: "Lilei", Age: 18 },
{ Name: "John", Age: 14 },
{ Name: "LinTao", Age: 25 }
];
var arrRes = Enumerable.from(myList).orderBy("x=>x.Age").where("x=>x.Age>=18").select("x=>x.Age").toArray();
alert(arrRes.length);
用过c#的话,对这个应该再熟悉不过了,大多数语法一致,只是现在是弱类型,没有代码提示和语法检查,但已经很难得了。