I have created array like below,
arr =[ {uName:"2015", 1:100,2:10,3:0},{uName:"2011",1:10,2:2,3:19},{uName:"2015",1:10,2:0,3:20}],
Here, I need to select arr[0][1]
and arr[2][1]
where uName is "2015"
.
Linq query is,
$.Enumerable.From(arr).Where(function(n){n.uName =="2015"}).Select(function(y){return y.1}).Sum()
Expected answer is:
arr[0][1] = 100, arr[2][1] = 10 (or) sum of these value 110 (arr[0][1] + arr[2][1])