我需要使用Linq.js从Json数据的三个字段中选择两个字段
所需的输出应该是
[{ "A": -27, C: "country 1" } , { "A": 28 , C: "country 2"} ]
从以下路径使用“linq.js”:[ https://raw.github.com/gist/1175460/fb7404d46cab20e31601740ab8b35d99a584f941/linq.js ]
样本数据
var Data = [{ "A": -27, "B": -39, C: "country 1" }, { "A": 28, "B": 0 , C: "country 2"}]
var filter = " x => x['A'], x['C'] ";
var findItem = Enumerable.From(Data)
.Select(filter)
.ToArray();
console.log(findItem);
JsFiddle 的代码:http: //jsfiddle.net/gLXNw/9/