0
我想操纵一个JSON文件,所以我尝试JSLINQ,但我无法弄清楚为什么我在groupBy()中出现错误。 The website that led me to this code.JSLINQ groupBy错误
var query = JSLINQ(json);
var result = query.groupBy(function (i) { //HERE is where the error hits.
return i.CustomerName; //Attribute of json
})
.select(function (i) {
console.log(i);
return {
CustomerName: i.Key, data: i.elements //I read that I get groupBy result like this.
.select(function (j) {
x = j.x, y = j.y //x and y are attributes
})
}
}).toArray();
query.groupBy不是一个函数