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不是一個函數